summary refs log tree commit diff
diff options
context:
space:
mode:
authorOren Novotny <oren@novotny.org>2019-01-15 20:24:12 -0500
committerOren Novotny <oren@novotny.org>2019-01-15 20:24:12 -0500
commitdbb735167dd1e0b5cc601f1eb799c286a18906ea (patch)
treedfa996c9cf91fdc2b7337e3c43d31f835ad592ce
parentMerge branch 'master' into netstandard (diff)
downloadBouncyCastle.NET-ed25519-dbb735167dd1e0b5cc601f1eb799c286a18906ea.tar.xz
ifdef's to support PORTABLE netstandard1/1.3 surface area
-rw-r--r--crypto/src/cmp/CertificateConfirmationContentBuilder.cs5
-rw-r--r--crypto/src/cmp/CmpException.cs5
-rw-r--r--crypto/src/cmp/ProtectedPkiMessage.cs4
-rw-r--r--crypto/src/cmp/ProtectedPkiMessageBuilder.cs5
-rw-r--r--crypto/src/crmf/CertificateRequestMessageBuilder.cs3
-rw-r--r--crypto/src/crmf/CrmfException.cs5
-rw-r--r--crypto/src/crmf/EncryptedValueBuilder.cs5
-rw-r--r--crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs8
8 files changed, 31 insertions, 9 deletions
diff --git a/crypto/src/cmp/CertificateConfirmationContentBuilder.cs b/crypto/src/cmp/CertificateConfirmationContentBuilder.cs
index 56f5d5ccb..3180d66a5 100644
--- a/crypto/src/cmp/CertificateConfirmationContentBuilder.cs
+++ b/crypto/src/cmp/CertificateConfirmationContentBuilder.cs
@@ -1,4 +1,5 @@
 using System.Collections;
+using System.Collections.Generic;
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cmp;
 using Org.BouncyCastle.Asn1.X509;
@@ -14,8 +15,8 @@ namespace Org.BouncyCastle.Cmp
     {
         DefaultSignatureAlgorithmIdentifierFinder sigAlgFinder = new DefaultSignatureAlgorithmIdentifierFinder();
         private DefaultDigestAlgorithmIdentifierFinder digestAlgFinder;
-        private ArrayList acceptedCerts = new ArrayList();
-        private ArrayList acceptedReqIds = new ArrayList();
+        private List<object> acceptedCerts = new List<object>();
+        private List<object> acceptedReqIds = new List<object>();
 
         public CertificateConfirmationContentBuilder() : this(new DefaultDigestAlgorithmIdentifierFinder())
         {
diff --git a/crypto/src/cmp/CmpException.cs b/crypto/src/cmp/CmpException.cs
index 2f50f7780..2237b453d 100644
--- a/crypto/src/cmp/CmpException.cs
+++ b/crypto/src/cmp/CmpException.cs
@@ -1,6 +1,7 @@
 using System;
+#if !PORTABLE
 using System.Runtime.Serialization;
-
+#endif
 
 namespace Org.BouncyCastle.Cmp
 {
@@ -18,8 +19,10 @@ namespace Org.BouncyCastle.Cmp
         {
         }
 
+#if !PORTABLE
         protected CmpException(SerializationInfo info, StreamingContext context) : base(info, context)
         {
         }
+#endif
     }
 }
diff --git a/crypto/src/cmp/ProtectedPkiMessage.cs b/crypto/src/cmp/ProtectedPkiMessage.cs
index d3cf4a524..e05efe768 100644
--- a/crypto/src/cmp/ProtectedPkiMessage.cs
+++ b/crypto/src/cmp/ProtectedPkiMessage.cs
@@ -116,7 +116,11 @@ namespace Org.BouncyCastle.Cmp
 
             streamCalculator.Stream.Write(enc, 0, enc.Length);
             streamCalculator.Stream.Flush();
+#if PORTABLE
+            streamCalculator.Stream.Dispose();
+#else
             streamCalculator.Stream.Close();
+#endif
 
             return streamCalculator.GetResult();
         }
diff --git a/crypto/src/cmp/ProtectedPkiMessageBuilder.cs b/crypto/src/cmp/ProtectedPkiMessageBuilder.cs
index 3ee223ba8..dd65fd2bc 100644
--- a/crypto/src/cmp/ProtectedPkiMessageBuilder.cs
+++ b/crypto/src/cmp/ProtectedPkiMessageBuilder.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cmp;
 using Org.BouncyCastle.Asn1.X509;
@@ -13,8 +14,8 @@ namespace Org.BouncyCastle.Cmp
     {
         private PkiHeaderBuilder hdrBuilBuilder;
         private PkiBody body;
-        private ArrayList generalInfos = new ArrayList();
-        private ArrayList extraCerts = new ArrayList();
+        private List<object> generalInfos = new List<object>();
+        private List<object> extraCerts = new List<object>();
 
         public ProtectedPkiMessageBuilder(GeneralName sender, GeneralName recipient) : this(PkiHeader.CMP_2000, sender,
             recipient)
diff --git a/crypto/src/crmf/CertificateRequestMessageBuilder.cs b/crypto/src/crmf/CertificateRequestMessageBuilder.cs
index 384f6a965..1c1eba320 100644
--- a/crypto/src/crmf/CertificateRequestMessageBuilder.cs
+++ b/crypto/src/crmf/CertificateRequestMessageBuilder.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Crmf;
@@ -17,7 +16,7 @@ namespace Org.BouncyCastle.Crmf
         private readonly BigInteger _certReqId;
         private X509ExtensionsGenerator _extGenerator;
         private CertTemplateBuilder _templateBuilder;
-        private ArrayList _controls= new ArrayList();
+        private List<object> _controls= new List<object>();
         private ISignatureFactory _popSigner;
         private PKMacBuilder _pkMacBuilder;
         private char[] _password;
diff --git a/crypto/src/crmf/CrmfException.cs b/crypto/src/crmf/CrmfException.cs
index c80f480b7..59aef319a 100644
--- a/crypto/src/crmf/CrmfException.cs
+++ b/crypto/src/crmf/CrmfException.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
+#if !PORTABLE
 using System.Runtime.Serialization;
+#endif
 using System.Text;
 
 namespace Org.BouncyCastle.Crmf
@@ -18,9 +20,10 @@ namespace Org.BouncyCastle.Crmf
         public CrmfException(string message, Exception innerException) : base(message, innerException)
         {
         }
-
+#if !PORTABLE
         protected CrmfException(SerializationInfo info, StreamingContext context) : base(info, context)
         {
         }
+#endif
     }
 }
diff --git a/crypto/src/crmf/EncryptedValueBuilder.cs b/crypto/src/crmf/EncryptedValueBuilder.cs
index 28d5b52b4..e8cf263f7 100644
--- a/crypto/src/crmf/EncryptedValueBuilder.cs
+++ b/crypto/src/crmf/EncryptedValueBuilder.cs
@@ -121,8 +121,11 @@ namespace Org.BouncyCastle.Crmf
             try
             {
                 eOut.Write(data, 0, data.Length);
-
+#if PORTABLE
+                eOut.Dispose();
+#else
                 eOut.Close();
+#endif
             }
             catch (IOException e)
             {
diff --git a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
index 8457585ff..48d85f0e3 100644
--- a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
+++ b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
@@ -42,7 +42,11 @@ namespace Org.BouncyCastle.Crmf
             byte[] d = _pubKeyInfo.GetDerEncoded();
             calc.Stream.Write(d, 0, d.Length);
             calc.Stream.Flush();
+#if PORTABLE
+            calc.Stream.Dispose();
+#else
             calc.Stream.Close();
+#endif
 
             this._publicKeyMAC = new PKMacValue(
                 (AlgorithmIdentifier)fact.AlgorithmDetails,
@@ -82,7 +86,11 @@ namespace Org.BouncyCastle.Crmf
             }
 
             calc.Stream.Flush();
+#if PORTABLE
+            calc.Stream.Dispose();
+#else
             calc.Stream.Close();
+#endif
             DefaultSignatureResult res = (DefaultSignatureResult)calc.GetResult();
             return new PopoSigningKey(popo, (AlgorithmIdentifier)signer.AlgorithmDetails, new DerBitString(res.Collect()));
         }