diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-11 14:55:17 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-11 14:55:17 +0700 |
commit | 806a62d3d17c9f7b34315b11c6f99de192ed9e33 (patch) | |
tree | 7c34006c1fb880355953281ce23c0722391530bc /crypto/src/asn1/BERBitString.cs | |
parent | NUnit3TestAdapter 4.4.2 (diff) | |
download | BouncyCastle.NET-ed25519-806a62d3d17c9f7b34315b11c6f99de192ed9e33.tar.xz |
Obsolete unused segmentLimit
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/BERBitString.cs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/crypto/src/asn1/BERBitString.cs b/crypto/src/asn1/BERBitString.cs index 2f5bd9cb7..e69e7a35f 100644 --- a/crypto/src/asn1/BERBitString.cs +++ b/crypto/src/asn1/BERBitString.cs @@ -6,7 +6,10 @@ namespace Org.BouncyCastle.Asn1 public class BerBitString : DerBitString { - private const int DefaultSegmentLimit = 1000; + public static BerBitString FromSequence(Asn1Sequence seq) + { + return new BerBitString(seq.MapElements(GetInstance)); + } internal static byte[] FlattenBitStrings(DerBitString[] bitStrings) { @@ -53,14 +56,12 @@ namespace Org.BouncyCastle.Asn1 } } - private readonly int segmentLimit; private readonly DerBitString[] elements; public BerBitString(byte data, int padBits) : base(data, padBits) { this.elements = null; - this.segmentLimit = DefaultSegmentLimit; } public BerBitString(byte[] data) @@ -69,22 +70,21 @@ namespace Org.BouncyCastle.Asn1 } public BerBitString(byte[] data, int padBits) - : this(data, padBits, DefaultSegmentLimit) + : base(data, padBits) { + this.elements = null; } + [Obsolete("Use version without segmentLimit (which is ignored anyway)")] public BerBitString(byte[] data, int padBits, int segmentLimit) - : base(data, padBits) + : this(data, padBits) { - this.elements = null; - this.segmentLimit = segmentLimit; } public BerBitString(int namedBits) : base(namedBits) { this.elements = null; - this.segmentLimit = DefaultSegmentLimit; } public BerBitString(Asn1Encodable obj) @@ -93,22 +93,21 @@ namespace Org.BouncyCastle.Asn1 } public BerBitString(DerBitString[] elements) - : this(elements, DefaultSegmentLimit) + : base(FlattenBitStrings(elements), false) { + this.elements = elements; } + [Obsolete("Use version without segmentLimit (which is ignored anyway)")] public BerBitString(DerBitString[] elements, int segmentLimit) - : base(FlattenBitStrings(elements), false) + : this(elements) { - this.elements = elements; - this.segmentLimit = segmentLimit; } internal BerBitString(byte[] contents, bool check) : base(contents, check) { this.elements = null; - this.segmentLimit = DefaultSegmentLimit; } internal override IAsn1Encoding GetEncoding(int encoding) |