diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs index 2f420f8cc5c9a..eda1cfd4eac1e 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; @@ -14,11 +13,11 @@ namespace System.Security.Cryptography.Asn1 [StructLayout(LayoutKind.Sequential)] internal partial struct DirectoryStringAsn { - internal string TeletexString; - internal string PrintableString; + internal string? TeletexString; + internal string? PrintableString; internal ReadOnlyMemory? UniversalString; - internal string Utf8String; - internal string BmpString; + internal string? Utf8String; + internal string? BmpString; #if DEBUG static DirectoryStringAsn() diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs index 4c89970450d32..727797d968754 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; @@ -15,7 +14,7 @@ namespace System.Security.Cryptography.Asn1 internal partial struct ECDomainParameters { internal System.Security.Cryptography.Asn1.SpecifiedECDomain? Specified; - internal Oid Named; + internal Oid? Named; #if DEBUG static ECDomainParameters() diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs index 79316b126f8e9..5525fc315cd61 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; @@ -15,14 +14,14 @@ namespace System.Security.Cryptography.Asn1 internal partial struct GeneralNameAsn { internal System.Security.Cryptography.Asn1.OtherNameAsn? OtherName; - internal string Rfc822Name; - internal string DnsName; + internal string? Rfc822Name; + internal string? DnsName; internal ReadOnlyMemory? X400Address; internal ReadOnlyMemory? DirectoryName; internal System.Security.Cryptography.Asn1.EdiPartyNameAsn? EdiPartyName; - internal string Uri; + internal string? Uri; internal ReadOnlyMemory? IPAddress; - internal string RegisteredId; + internal string? RegisteredId; #if DEBUG static GeneralNameAsn() diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs index 0ff367aa30826..9a1c275d7d19e 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SafeBagAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SafeBagAsn.xml.cs index e961640738bef..c34015fc821a2 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SafeBagAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SafeBagAsn.xml.cs @@ -16,7 +16,7 @@ internal partial struct SafeBagAsn { internal string BagId; internal ReadOnlyMemory BagValue; - internal System.Security.Cryptography.Asn1.AttributeAsn[] BagAttributes; + internal System.Security.Cryptography.Asn1.AttributeAsn[]? BagAttributes; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedDataAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedDataAsn.xml.cs index 8938c54cd46aa..fffd2c0e6f840 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedDataAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedDataAsn.xml.cs @@ -16,7 +16,7 @@ internal partial struct EncryptedDataAsn { internal int Version; internal System.Security.Cryptography.Asn1.Pkcs7.EncryptedContentInfoAsn EncryptedContentInfo; - internal System.Security.Cryptography.Asn1.AttributeAsn[] UnprotectedAttributes; + internal System.Security.Cryptography.Asn1.AttributeAsn[]? UnprotectedAttributes; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/PrivateKeyInfoAsn.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/PrivateKeyInfoAsn.xml.cs index 12ba027759a27..648489e6c9e2c 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/PrivateKeyInfoAsn.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/PrivateKeyInfoAsn.xml.cs @@ -17,7 +17,7 @@ internal partial struct PrivateKeyInfoAsn internal byte Version; internal System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn PrivateKeyAlgorithm; internal ReadOnlyMemory PrivateKey; - internal System.Security.Cryptography.Asn1.AttributeAsn[] Attributes; + internal System.Security.Cryptography.Asn1.AttributeAsn[]? Attributes; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/SpecifiedECDomain.xml.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/SpecifiedECDomain.xml.cs index f1f44d802b151..dbe070a250e6f 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/SpecifiedECDomain.xml.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/SpecifiedECDomain.xml.cs @@ -19,7 +19,7 @@ internal partial struct SpecifiedECDomain internal ReadOnlyMemory Base; internal ReadOnlyMemory Order; internal ReadOnlyMemory? Cofactor; - internal Oid Hash; + internal Oid? Hash; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt b/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt index b6866081ab6d4..3433cd17a4e0a 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt @@ -127,7 +127,6 @@ namespace // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Collections.Generic; @@ -690,9 +689,9 @@ namespace Asn1Tag.PrimitiveOctetString - internal Oid ; + internal Oid? ; - internal string ; + internal string? ; Oid string @@ -761,7 +760,7 @@ namespace - internal string ; + internal string? ; string @@ -784,7 +783,7 @@ namespace new Asn1Tag(UniversalTagNumber.) - internal [] ; + internal []? ; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/CertificateChoiceAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/CertificateChoiceAsn.xml.cs index f0efb33f953a0..073aac1a878b5 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/CertificateChoiceAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/CertificateChoiceAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EnvelopedDataAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EnvelopedDataAsn.xml.cs index 005d78a2aaf90..dfcaffa9ee05a 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EnvelopedDataAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EnvelopedDataAsn.xml.cs @@ -18,7 +18,7 @@ internal partial struct EnvelopedDataAsn internal System.Security.Cryptography.Pkcs.Asn1.OriginatorInfoAsn? OriginatorInfo; internal System.Security.Cryptography.Pkcs.Asn1.RecipientInfoAsn[] RecipientInfos; internal System.Security.Cryptography.Asn1.Pkcs7.EncryptedContentInfoAsn EncryptedContentInfo; - internal System.Security.Cryptography.Asn1.AttributeAsn[] UnprotectedAttributes; + internal System.Security.Cryptography.Asn1.AttributeAsn[]? UnprotectedAttributes; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientIdentifierAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientIdentifierAsn.xml.cs index 8ccaea7083279..cc5df62f2dc4a 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientIdentifierAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientIdentifierAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorIdentifierOrKeyAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorIdentifierOrKeyAsn.xml.cs index 82acb18085f8b..b9a72cc6aa9b9 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorIdentifierOrKeyAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorIdentifierOrKeyAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorInfoAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorInfoAsn.xml.cs index 76af43c76c0ee..009aef45448e2 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorInfoAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorInfoAsn.xml.cs @@ -14,8 +14,8 @@ namespace System.Security.Cryptography.Pkcs.Asn1 [StructLayout(LayoutKind.Sequential)] internal partial struct OriginatorInfoAsn { - internal System.Security.Cryptography.Pkcs.Asn1.CertificateChoiceAsn[] CertificateSet; - internal ReadOnlyMemory[] RevocationInfoChoices; + internal System.Security.Cryptography.Pkcs.Asn1.CertificateChoiceAsn[]? CertificateSet; + internal ReadOnlyMemory[]? RevocationInfoChoices; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyInformation.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyInformation.xml.cs index b70e9ae6259b4..2836c2ad36a78 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyInformation.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyInformation.xml.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.Pkcs.Asn1 internal partial struct PolicyInformation { internal string PolicyIdentifier; - internal System.Security.Cryptography.Pkcs.Asn1.PolicyQualifierInfo[] PolicyQualifiers; + internal System.Security.Cryptography.Pkcs.Asn1.PolicyQualifierInfo[]? PolicyQualifiers; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientIdentifierAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientIdentifierAsn.xml.cs index b8e3f7c987255..252367118567a 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientIdentifierAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientIdentifierAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientInfoAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientInfoAsn.xml.cs index 8f4a41a3ce48c..4290612912cbb 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientInfoAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientInfoAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampReq.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampReq.xml.cs index f99b08c3121c5..704fcc6995eb1 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampReq.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampReq.xml.cs @@ -21,7 +21,7 @@ internal partial struct Rfc3161TimeStampReq internal Oid? ReqPolicy; internal ReadOnlyMemory? Nonce; internal bool CertReq; - internal System.Security.Cryptography.Asn1.X509ExtensionAsn[] Extensions; + internal System.Security.Cryptography.Asn1.X509ExtensionAsn[]? Extensions; #if DEBUG static Rfc3161TimeStampReq() diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TstInfo.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TstInfo.xml.cs index 8bf7ca2a8a65f..49a96ecbd8f89 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TstInfo.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TstInfo.xml.cs @@ -25,7 +25,7 @@ internal partial struct Rfc3161TstInfo internal bool Ordering; internal ReadOnlyMemory? Nonce; internal System.Security.Cryptography.Asn1.GeneralNameAsn? Tsa; - internal System.Security.Cryptography.Asn1.X509ExtensionAsn[] Extensions; + internal System.Security.Cryptography.Asn1.X509ExtensionAsn[]? Extensions; #if DEBUG static Rfc3161TstInfo() diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedAttributesSet.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedAttributesSet.xml.cs index 8b2e7a136c6c7..7c81d8cc699f5 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedAttributesSet.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedAttributesSet.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Collections.Generic; @@ -15,7 +14,7 @@ namespace System.Security.Cryptography.Pkcs [StructLayout(LayoutKind.Sequential)] internal partial struct SignedAttributesSet { - internal System.Security.Cryptography.Asn1.AttributeAsn[] SignedAttributes; + internal System.Security.Cryptography.Asn1.AttributeAsn[]? SignedAttributes; #if DEBUG static SignedAttributesSet() diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedDataAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedDataAsn.xml.cs index 75fa98e4c5330..1af67b092ff28 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedDataAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedDataAsn.xml.cs @@ -17,8 +17,8 @@ internal partial struct SignedDataAsn internal int Version; internal System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn[] DigestAlgorithms; internal System.Security.Cryptography.Pkcs.Asn1.EncapsulatedContentInfoAsn EncapContentInfo; - internal System.Security.Cryptography.Pkcs.Asn1.CertificateChoiceAsn[] CertificateSet; - internal ReadOnlyMemory[] Crls; + internal System.Security.Cryptography.Pkcs.Asn1.CertificateChoiceAsn[]? CertificateSet; + internal ReadOnlyMemory[]? Crls; internal System.Security.Cryptography.Pkcs.Asn1.SignerInfoAsn[] SignerInfos; internal void Encode(AsnWriter writer) diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignerIdentifierAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignerIdentifierAsn.xml.cs index 2a0a97b71c6cc..5cb956e962acb 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignerIdentifierAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignerIdentifierAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateAsn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateAsn.xml.cs index ae7922fcacd6d..52a06d97d62b6 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateAsn.xml.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.Pkcs.Asn1 internal partial struct SigningCertificateAsn { internal System.Security.Cryptography.Pkcs.Asn1.EssCertId[] Certs; - internal System.Security.Cryptography.Pkcs.Asn1.PolicyInformation[] Policies; + internal System.Security.Cryptography.Pkcs.Asn1.PolicyInformation[]? Policies; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateV2Asn.xml.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateV2Asn.xml.cs index 01c89290d3e0d..6556faf23f8f2 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateV2Asn.xml.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateV2Asn.xml.cs @@ -15,7 +15,7 @@ namespace System.Security.Cryptography.Pkcs.Asn1 internal partial struct SigningCertificateV2Asn { internal System.Security.Cryptography.Pkcs.Asn1.EssCertIdV2[] Certs; - internal System.Security.Cryptography.Pkcs.Asn1.PolicyInformation[] Policies; + internal System.Security.Cryptography.Pkcs.Asn1.PolicyInformation[]? Policies; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs index 15e90765df475..b126b1aa099ab 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs @@ -38,7 +38,7 @@ public X509ExtensionCollection GetExtensions() return coll; } - X509ExtensionAsn[] rawExtensions = _parsedData.Extensions; + X509ExtensionAsn[] rawExtensions = _parsedData.Extensions!; foreach (X509ExtensionAsn rawExtension in rawExtensions) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs index c2e1d897b3d7e..a9ff1feb53166 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampTokenInfo.cs @@ -97,7 +97,7 @@ public X509ExtensionCollection GetExtensions() return coll; } - X509ExtensionAsn[] rawExtensions = _parsedData.Extensions; + X509ExtensionAsn[] rawExtensions = _parsedData.Extensions!; foreach (X509ExtensionAsn rawExtension in rawExtensions) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs index d7a5e8a2850c5..d45d274e7639b 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs @@ -80,7 +80,7 @@ public X509Certificate2Collection Certificates return coll; } - CertificateChoiceAsn[] certChoices = _signedData.CertificateSet; + CertificateChoiceAsn[]? certChoices = _signedData.CertificateSet; if (certChoices == null) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixExportProvider.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixExportProvider.cs index b2bc76f0fe061..89c5e0ce7eaf0 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixExportProvider.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixExportProvider.cs @@ -197,25 +197,23 @@ private void BuildBags( attrBytes[1] = sizeof(int); MemoryMarshal.Write(attrBytes.AsSpan(2), ref keyIdx); + AttributeAsn attribute = new AttributeAsn + { + AttrType = new Oid(Oids.LocalKeyId, null), + AttrValues = new ReadOnlyMemory[] + { + attrBytes, + } + }; keyBags[keyIdx] = new SafeBagAsn { BagId = Oids.Pkcs12ShroudedKeyBag, BagValue = ExportPkcs8(certPal, passwordSpan), - BagAttributes = new[] - { - new AttributeAsn - { - AttrType = new Oid(Oids.LocalKeyId, null), - AttrValues = new ReadOnlyMemory[] - { - attrBytes, - } - } - } + BagAttributes = new[] { attribute } }; // Reuse the attribute between the cert and the key. - certAttrs[certIdx] = keyBags[keyIdx].BagAttributes[0]; + certAttrs[certIdx] = attribute; keyIdx++; } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixPkcs12Reader.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixPkcs12Reader.cs index 808ff35eba563..d1d453246f776 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixPkcs12Reader.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/UnixPkcs12Reader.cs @@ -248,7 +248,7 @@ private void Decrypt(ReadOnlySpan password, ReadOnlyMemory authSafeC // Nothing requires that there be fewer keys than certs, // but it's sort of nonsensical when loading this way. CertBagAsn[] certBags = ArrayPool.Shared.Rent(10); - AttributeAsn[][] certBagAttrs = ArrayPool.Shared.Rent(10); + AttributeAsn[]?[] certBagAttrs = ArrayPool.Shared.Rent(10); SafeBagAsn[] keyBags = ArrayPool.Shared.Rent(10); RentedSubjectPublicKeyInfo[]? publicKeyInfos = null; AsymmetricAlgorithm[]? keys = null; @@ -326,7 +326,7 @@ private void Decrypt(ReadOnlySpan password, ReadOnlyMemory authSafeC } ArrayPool.Shared.Return(certBags, clearArray: true); - ArrayPool.Shared.Return(certBagAttrs, clearArray: true); + ArrayPool.Shared.Return(certBagAttrs, clearArray: true); ArrayPool.Shared.Return(keyBags, clearArray: true); } } @@ -356,7 +356,7 @@ private static ContentInfoAsn[] DecodeSafeContents(ReadOnlyMemory authSafe private void DecryptAndProcessSafeContents( ReadOnlySpan password, ref CertBagAsn[] certBags, - ref AttributeAsn[][] certBagAttrs, + ref AttributeAsn[]?[] certBagAttrs, ref int certBagIdx, ref SafeBagAsn[] keyBags, ref int keyBagIdx) @@ -455,7 +455,7 @@ private void ExtractPrivateKeys( private void BuildCertsWithKeys( CertBagAsn[] certBags, - AttributeAsn[][] certBagAttrs, + AttributeAsn[]?[] certBagAttrs, CertAndKey[] certs, int certBagIdx, SafeBagAsn[] keyBags, @@ -581,7 +581,7 @@ private static int FindMatchingKey( { for (int i = 0; i < keyBagCount; i++) { - foreach (AttributeAsn attr in keyBags[i].BagAttributes) + foreach (AttributeAsn attr in keyBags[i].BagAttributes ?? Array.Empty()) { if (attr.AttrType.Value == Oids.LocalKeyId && attr.AttrValues.Length > 0) { @@ -656,7 +656,7 @@ private static void DecryptSafeContents( private static void ProcessSafeContents( in ContentInfoAsn safeContentsAsn, ref CertBagAsn[] certBags, - ref AttributeAsn[][] certBagAttrs, + ref AttributeAsn[]?[] certBagAttrs, ref int certBagIdx, ref SafeBagAsn[] keyBags, ref int keyBagIdx) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointAsn.xml.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointAsn.xml.cs index 94adda8a90dd1..23af6308a9ca6 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointAsn.xml.cs @@ -16,7 +16,7 @@ internal partial struct DistributionPointAsn { internal System.Security.Cryptography.X509Certificates.Asn1.DistributionPointNameAsn? DistributionPoint; internal System.Security.Cryptography.X509Certificates.Asn1.ReasonFlagsAsn? Reasons; - internal System.Security.Cryptography.Asn1.GeneralNameAsn[] CRLIssuer; + internal System.Security.Cryptography.Asn1.GeneralNameAsn[]? CRLIssuer; internal void Encode(AsnWriter writer) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointNameAsn.xml.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointNameAsn.xml.cs index 2a4d6d51d9490..03164cdb84d75 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointNameAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointNameAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Collections.Generic; @@ -15,7 +14,7 @@ namespace System.Security.Cryptography.X509Certificates.Asn1 [StructLayout(LayoutKind.Sequential)] internal partial struct DistributionPointNameAsn { - internal System.Security.Cryptography.Asn1.GeneralNameAsn[] FullName; + internal System.Security.Cryptography.Asn1.GeneralNameAsn[]? FullName; internal ReadOnlyMemory? NameRelativeToCRLIssuer; #if DEBUG diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TbsCertificateAsn.xml.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TbsCertificateAsn.xml.cs index cdebe2a89be97..c9ea25a04a1b3 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TbsCertificateAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TbsCertificateAsn.xml.cs @@ -25,7 +25,7 @@ internal partial struct TbsCertificateAsn internal System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn SubjectPublicKeyInfo; internal ReadOnlyMemory? IssuerUniqueId; internal ReadOnlyMemory? SubjectUniqueId; - internal System.Security.Cryptography.Asn1.X509ExtensionAsn[] Extensions; + internal System.Security.Cryptography.Asn1.X509ExtensionAsn[]? Extensions; #if DEBUG static TbsCertificateAsn() diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TimeAsn.xml.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TimeAsn.xml.cs index e382786602d93..4b2f3ace204d2 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TimeAsn.xml.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Asn1/TimeAsn.xml.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable #pragma warning disable SA1028 // ignore whitespace warnings for generated code using System; using System.Runtime.InteropServices;