diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-13 15:31:14 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-13 15:31:14 +0700 |
commit | 8f5512b04798e1a527bdb479dc2b0885f9a6ca7c (patch) | |
tree | 445cb195b93afd9f6c9766c8e17308c139931f6a /crypto/src/asn1/Asn1OctetString.cs | |
parent | Fix ParallelHash copy constructor (diff) | |
download | BouncyCastle.NET-ed25519-8f5512b04798e1a527bdb479dc2b0885f9a6ca7c.tar.xz |
Asn1OctetString constructor from Span<byte> (copying)
Diffstat (limited to 'crypto/src/asn1/Asn1OctetString.cs')
-rw-r--r-- | crypto/src/asn1/Asn1OctetString.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/src/asn1/Asn1OctetString.cs b/crypto/src/asn1/Asn1OctetString.cs index e52e50759..d8a7bf27a 100644 --- a/crypto/src/asn1/Asn1OctetString.cs +++ b/crypto/src/asn1/Asn1OctetString.cs @@ -88,6 +88,13 @@ namespace Org.BouncyCastle.Asn1 this.contents = contents; } +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + internal Asn1OctetString(ReadOnlySpan<byte> contents) + { + this.contents = contents.ToArray(); + } +#endif + public Stream GetOctetStream() { return new MemoryStream(contents, false); |