summary refs log tree commit diff
path: root/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-04-20 18:40:56 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-04-20 18:40:56 +0700
commit758b05345c9d2f0b412f75435cb31231a7f70311 (patch)
tree5600970e299bc813a44ee48d2e3c8ba8eca9572d /crypto/src/asn1/x509/SubjectPublicKeyInfo.cs
parentBigInteger construction from little-endian (diff)
downloadBouncyCastle.NET-ed25519-758b05345c9d2f0b412f75435cb31231a7f70311.tar.xz
Refactoring: reduced allocations
Diffstat (limited to 'crypto/src/asn1/x509/SubjectPublicKeyInfo.cs')
-rw-r--r--crypto/src/asn1/x509/SubjectPublicKeyInfo.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs b/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs
index 4875152eb..234990fc7 100644
--- a/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs
+++ b/crypto/src/asn1/x509/SubjectPublicKeyInfo.cs
@@ -49,7 +49,15 @@ namespace Org.BouncyCastle.Asn1.X509
             this.algID = algID;
         }
 
-		private SubjectPublicKeyInfo(
+#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+        public SubjectPublicKeyInfo(AlgorithmIdentifier algID, ReadOnlySpan<byte> publicKey)
+        {
+            this.keyData = new DerBitString(publicKey);
+            this.algID = algID;
+        }
+#endif
+
+        private SubjectPublicKeyInfo(
             Asn1Sequence seq)
         {
 			if (seq.Count != 2)