// Attribute -> Hashes public static List <KeyValuePair <Common.HashAlgorithmName, byte[]> > GetESSCertIDv2Entries(CryptographicAttributeObject attribute) { if (attribute == null) { throw new ArgumentNullException(nameof(attribute)); } if (!StringComparer.Ordinal.Equals(Oids.SigningCertificateV2, attribute.Oid.Value)) { throw new ArgumentException(string.Format( CultureInfo.CurrentCulture, Strings.SigningCertificateV2AttributeRequired, Oids.SigningCertificateV2), nameof(attribute)); } var entries = new List <KeyValuePair <Common.HashAlgorithmName, byte[]> >(); var reader = attribute.ToDerSequenceReader(); while (reader.HasData) { entries.Add(GetESSCertIDv2Entry(reader.ReadSequence())); } return(entries); }
/// <summary> /// Attribute -> SignatureType values with no validation. /// </summary> private static List <SignatureType> GetCommitmentTypeIndicationRawValues(CryptographicAttributeObject attribute) { var values = new List <SignatureType>(1); var reader = attribute.ToDerSequenceReader(); while (reader.HasData) { values.Add(GetSignatureType(reader.ReadOidAsString())); } return(values); }