184 references to BER
System.DirectoryServices.Protocols (19)
System\DirectoryServices\Protocols\common\DirectoryControl.cs (19)
113t_writer ??= new AsnWriter(AsnEncodingRules.BER); 169AsnDecoder.ReadSequence(asnSpan, AsnEncodingRules.BER, out int sequenceContentOffset, out int sequenceContentLength, out int bytesConsumed); 174asnReadSuccessful = AsnDecoder.TryReadInt32(asnSpan, AsnEncodingRules.BER, out int size, out bytesConsumed); 180cookie = AsnDecoder.ReadOctetString(asnSpan, AsnEncodingRules.BER, out bytesConsumed); 192AsnDecoder.ReadSequence(asnSpan, AsnEncodingRules.BER, out int sequenceContentOffset, out int sequenceContentLength, out int bytesConsumed); 196result = AsnDecoder.ReadEnumeratedValue<ResultCode>(asnSpan.Slice(sequenceContentOffset, sequenceContentLength), AsnEncodingRules.BER, out bytesConsumed); 207AsnDecoder.ReadSequence(asnSpan, AsnEncodingRules.BER, out int sequenceContentOffset, out int sequenceContentLength, out int bytesConsumed); 212asnReadSuccessful = AsnDecoder.TryReadInt32(asnSpan, AsnEncodingRules.BER, out int moreResults, out bytesConsumed); 216asnReadSuccessful = AsnDecoder.TryReadInt32(asnSpan, AsnEncodingRules.BER, out int count, out bytesConsumed); 220dirsyncCookie = AsnDecoder.ReadOctetString(asnSpan, AsnEncodingRules.BER, out bytesConsumed); 232AsnDecoder.ReadSequence(asnSpan, AsnEncodingRules.BER, out int sequenceContentOffset, out int sequenceContentLength, out int bytesConsumed); 237result = AsnDecoder.ReadEnumeratedValue<ResultCode>(asnSpan, AsnEncodingRules.BER, out bytesConsumed); 249AsnEncodingRules.BER, out bytesConsumed, out int octetStringLength, SortResponseControl.AttributeNameTag); 255attributeNameBuffer = AsnDecoder.ReadOctetString(asnSpan, AsnEncodingRules.BER, out bytesConsumed, SortResponseControl.AttributeNameTag); 273AsnDecoder.ReadSequence(asnSpan, AsnEncodingRules.BER, out int sequenceContentOffset, out int sequenceContentLength, out int bytesConsumed); 278asnReadSuccessful = AsnDecoder.TryReadInt32(asnSpan, AsnEncodingRules.BER, out int position, out bytesConsumed); 282asnReadSuccessful = AsnDecoder.TryReadInt32(asnSpan, AsnEncodingRules.BER, out int count, out bytesConsumed); 286result = AsnDecoder.ReadEnumeratedValue<ResultCode>(asnSpan, AsnEncodingRules.BER, out bytesConsumed); 294context = AsnDecoder.ReadOctetString(asnSpan, AsnEncodingRules.BER, out bytesConsumed);
System.Formats.Asn1 (5)
System\Formats\Asn1\AsnDecoder.cs (2)
695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER); 700if (ruleSet != AsnEncodingRules.BER &&
System\Formats\Asn1\AsnWriter.cs (2)
44if (ruleSet != AsnEncodingRules.BER && 738var reader = new AsnReader(new ReadOnlyMemory<byte>(buffer, start, len), AsnEncodingRules.BER);
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
51/// In <see cref="AsnEncodingRules.BER"/> and <see cref="AsnEncodingRules.DER"/> modes,
System.Security.Cryptography (94)
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (5)
67if (!AsnDecoder.TryReadEncodedValue(source, AsnEncodingRules.BER, out _, out _, out _, out int consumed) || 87byte[] ret = AsnDecoder.ReadOctetString(encodedOctets.Span, AsnEncodingRules.BER, out int consumed); 115AsnEncodingRules.BER, 133if (!AsnDecoder.TryReadEncodedValue(source, AsnEncodingRules.BER, out _, out _, out _, out int consumed)) 321AsnEncodingRules.BER,
src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (2)
869AsnValueReader reader = new AsnValueReader(privateKeyContents.Span, AsnEncodingRules.BER); 1838AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.ECDsa.cs (1)
72ECPrivateKey ecPrivateKey = ECPrivateKey.Decode(manager.Memory, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (2)
50DssParms parms = DssParms.Decode(algId.Parameters.Value, AsnEncodingRules.BER); 113DssParms parms = DssParms.Decode(algId.Parameters.Value, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
255AsnDecoder.ReadEncodedValue(data, AsnEncodingRules.BER, out _, out _, out bytesRead);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
115AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 142AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (6)
107AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 291AsnValueReader reader = new(decrypted, AsnEncodingRules.BER); 319AsnValueReader reader = new(decrypted, AsnEncodingRules.BER); 350AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 401AsnWriter pkcs8Writer = new AsnWriter(AsnEncodingRules.BER); 437AsnWriter pkcs8Writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (3)
2080AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length); 2109AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length); 2175MLDsaPrivateKeyAsn dsaKey = MLDsaPrivateKeyAsn.Decode(privateKeyContents, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (2)
1728MLKemPrivateKeyAsn kemKey = MLKemPrivateKeyAsn.Decode(privateKeyContents, AsnEncodingRules.BER); 1813AsnWriter tmp = new(AsnEncodingRules.BER, initialCapacity: written);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (6)
520PBES2Params pbes2Params = PBES2Params.Decode(algorithmParameters.Value, AsnEncodingRules.BER); 649AsnEncodingRules.BER); 702AsnEncodingRules.BER, 730Pbkdf2Params pbkdf2Params = Pbkdf2Params.Decode(parameters.Value, AsnEncodingRules.BER); 819PBEParameter pbeParameters = PBEParameter.Decode(algorithmParameters.Value, AsnEncodingRules.BER); 882AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
166AsnWriter contentsWriter = new AsnWriter(AsnEncodingRules.BER); 227AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 309AsnWriter contentsWriter = new AsnWriter(AsnEncodingRules.BER); 310AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12CertBag.cs (5)
52_decoded = CertBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 65_decoded = CertBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 105AsnEncodingRules.BER, 123AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 130CertBagAsn decoded = CertBagAsn.Decode(bagValue, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (3)
61PfxAsn pfx = PfxAsn.Decode(maybeCopy, AsnEncodingRules.BER); 87SignedDataAsn signedData = SignedDataAsn.Decode(pfx.AuthSafe.Content, AsnEncodingRules.BER); 110AsnValueReader authSafeReader = new AsnValueReader(authSafeBytes.Span, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
103AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (4)
215EncryptedDataAsn encryptedData = EncryptedDataAsn.Decode(_encrypted, AsnEncodingRules.BER); 286AsnValueReader reader = new AsnValueReader(serialized.Span, AsnEncodingRules.BER); 437writer = new AsnWriter(AsnEncodingRules.BER); 444writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (3)
34_decoded = SecretBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 60AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 67SecretBagAsn decoded = SecretBagAsn.Decode(bagValue, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
74AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 257AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
49RSAPublicKeyAsn.Decode(keyData, AsnEncodingRules.BER); 166AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.Pkcs1.cs (2)
34RSAPrivateKeyAsn key = RSAPrivateKeyAsn.Decode(keyData, AsnEncodingRules.BER); 109RSAPublicKeyAsn key = RSAPublicKeyAsn.Decode(keyData, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (3)
493AsnEncodingRules.BER, 609AsnEncodingRules.BER, 813_ = RSAPrivateKeyAsn.Decode(pkcs1Priv, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (2)
1899AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length); 1927AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (1)
636if (!AsnDecoder.TryDecodeLength(lengthPart, AsnEncodingRules.BER, out int? decoded, out int decodedLength))
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (15)
142AsnDecoder.ReadSequence(data.Span, AsnEncodingRules.BER, out _, out _, out int trimLength); 145PfxAsn pfxAsn = PfxAsn.Decode(data, AsnEncodingRules.BER); 190AsnValueReader outer = new AsnValueReader(authSafeContents, AsnEncodingRules.BER); 279AsnValueReader outer = new AsnValueReader(contentData.Span, AsnEncodingRules.BER); 297CertBagAsn certBag = CertBagAsn.Decode(bag.BagValue, AsnEncodingRules.BER); 344AsnEncodingRules.BER); 507EncryptedDataAsn.Decode(safeContentsAsn.Content, AsnEncodingRules.BER); 582AsnEncodingRules.BER); 588AsnEncodingRules.BER); 605AsnEncodingRules.BER); 837AsnEncodingRules.BER, 1007AsnEncodingRules.BER); 1117AsnValueReader reader = new AsnValueReader(decrypted, AsnEncodingRules.BER); 1145AsnValueReader reader = new AsnValueReader(decrypted, AsnEncodingRules.BER); 1206AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
System\Security\Cryptography\EccKeyFormatHelper.cs (4)
84AsnEncodingRules.BER, 111ECPrivateKey key = ECPrivateKey.Decode(keyData, AsnEncodingRules.BER); 295AsnReader primeReader = new AsnReader(specifiedParameters.FieldID.Parameters, AsnEncodingRules.BER); 313AsnReader char2Reader = new AsnReader(specifiedParameters.FieldID.Parameters, AsnEncodingRules.BER);
System\Security\Cryptography\Helpers.cs (2)
168AsnEncodingRules.BER, 185byte[] ret = AsnDecoder.ReadOctetString(input, AsnEncodingRules.BER, out consumed);
System\Security\Cryptography\RSA.cs (2)
897AsnEncodingRules.BER, 927AsnEncodingRules.BER,
System\Security\Cryptography\X509Certificates\X509BasicConstraintsExtension.cs (1)
168BasicConstraintsAsn constraints = BasicConstraintsAsn.Decode(encoded, AsnEncodingRules.BER);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (5)
134AsnValueReader reader = new AsnValueReader(memory.Span, AsnEncodingRules.BER); 160AsnValueReader reader = new AsnValueReader(memory.Span, AsnEncodingRules.BER); 229CertBagAsn certBag = CertBagAsn.Decode(safeBag.BagValue, AsnEncodingRules.BER); 261PrivateKeyInfoAsn.Decode(safeBag.BagValue, AsnEncodingRules.BER); 525AsnEncodingRules.BER);
System\Security\Cryptography\X509Certificates\X509EnhancedKeyUsageExtension.cs (1)
90AsnReader reader = new AsnReader(encoded, AsnEncodingRules.BER);
System\Security\Cryptography\X509Certificates\X509KeyUsageExtension.cs (1)
70AsnValueReader reader = new AsnValueReader(encoded, AsnEncodingRules.BER);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (1)
108AsnEncodingRules.BER,
System.Security.Cryptography.Pkcs (66)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (2)
71AsnEncodingRules.BER); 103AsnReader reader = new AsnReader(asn.Parameters.Value, AsnEncodingRules.BER);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Asn.cs (1)
20AsnValueReader reader = new AsnValueReader(encodedMessage, AsnEncodingRules.BER);
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (2)
110AsnEncodingRules.BER); 125AsnReader reader = new AsnReader(contentEncryptionAlgorithm.Parameters.Value, AsnEncodingRules.BER);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decode.cs (2)
29EnvelopedDataAsn data = EnvelopedDataAsn.Decode(copy, AsnEncodingRules.BER); 89AsnValueReader reader = new AsnValueReader(encodedMessage, AsnEncodingRules.BER);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (1)
128AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Encrypt.cs (1)
185AsnEncodingRules.BER,
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (7)
67if (!AsnDecoder.TryReadEncodedValue(source, AsnEncodingRules.BER, out _, out _, out _, out int consumed) || 87byte[] ret = AsnDecoder.ReadOctetString(encodedOctets.Span, AsnEncodingRules.BER, out int consumed); 115AsnEncodingRules.BER, 133if (!AsnDecoder.TryReadEncodedValue(source, AsnEncodingRules.BER, out _, out _, out _, out int consumed)) 179AsnEncodingRules.BER, 196byte[] ret = AsnDecoder.ReadOctetString(input, AsnEncodingRules.BER, out consumed); 321AsnEncodingRules.BER,
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
255AsnDecoder.ReadEncodedValue(data, AsnEncodingRules.BER, out _, out _, out bytesRead);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
115AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 142AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (6)
107AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 291AsnValueReader reader = new(decrypted, AsnEncodingRules.BER); 319AsnValueReader reader = new(decrypted, AsnEncodingRules.BER); 350AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 401AsnWriter pkcs8Writer = new AsnWriter(AsnEncodingRules.BER); 437AsnWriter pkcs8Writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (6)
520PBES2Params pbes2Params = PBES2Params.Decode(algorithmParameters.Value, AsnEncodingRules.BER); 649AsnEncodingRules.BER); 702AsnEncodingRules.BER, 730Pbkdf2Params pbkdf2Params = Pbkdf2Params.Decode(parameters.Value, AsnEncodingRules.BER); 819PBEParameter pbeParameters = PBEParameter.Decode(algorithmParameters.Value, AsnEncodingRules.BER); 882AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
166AsnWriter contentsWriter = new AsnWriter(AsnEncodingRules.BER); 227AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 309AsnWriter contentsWriter = new AsnWriter(AsnEncodingRules.BER); 310AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12CertBag.cs (5)
52_decoded = CertBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 65_decoded = CertBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 105AsnEncodingRules.BER, 123AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 130CertBagAsn decoded = CertBagAsn.Decode(bagValue, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (3)
61PfxAsn pfx = PfxAsn.Decode(maybeCopy, AsnEncodingRules.BER); 87SignedDataAsn signedData = SignedDataAsn.Decode(pfx.AuthSafe.Content, AsnEncodingRules.BER); 110AsnValueReader authSafeReader = new AsnValueReader(authSafeBytes.Span, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
103AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (4)
215EncryptedDataAsn encryptedData = EncryptedDataAsn.Decode(_encrypted, AsnEncodingRules.BER); 286AsnValueReader reader = new AsnValueReader(serialized.Span, AsnEncodingRules.BER); 437writer = new AsnWriter(AsnEncodingRules.BER); 444writer = new AsnWriter(AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (3)
34_decoded = SecretBagAsn.Decode(EncodedBagValue, AsnEncodingRules.BER); 60AsnWriter writer = new AsnWriter(AsnEncodingRules.BER); 67SecretBagAsn decoded = SecretBagAsn.Decode(bagValue, AsnEncodingRules.BER);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
74AsnValueReader reader = new AsnValueReader(source.Span, AsnEncodingRules.BER); 257AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
283newSignedAttrsWriter = new AsnWriter(AsnEncodingRules.BER);
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (3)
297AsnValueReader reader = new AsnValueReader(encodedBytes.Span, AsnEncodingRules.BER); 599AsnEncodingRules.BER); 626AsnEncodingRules.BER);
System\Security\Cryptography\Pkcs\SignedCms.cs (6)
146copy = SignedDataAsn.Decode(detachedWriter.Encode(), AsnEncodingRules.BER); 150AsnWriter attachedWriter = new AsnWriter(AsnEncodingRules.BER); 172_signedData = SignedDataAsn.Decode(_heldData, AsnEncodingRules.BER); 219AsnValueReader reader = new AsnValueReader(encodedMessage, AsnEncodingRules.BER); 259AsnReader reader = new AsnReader(wrappedContent, AsnEncodingRules.BER); 437AsnEncodingRules.BER,
System\Security\Cryptography\Pkcs\SignerInfo.cs (3)
53AsnEncodingRules.BER); 152SignerInfoAsn counterSigner = SignerInfoAsn.Decode(counterSignerBytes, AsnEncodingRules.BER); 268SignerInfoAsn parsedData = SignerInfoAsn.Decode(attrValue, AsnEncodingRules.BER);