public static AuthorityKeyIdentifierExtension FromExtensionData(byte[] data) { var seq = Asn1Sequence.ReadNode(data); var node = (Asn1CustomNode)seq.Nodes[0]; return(new AuthorityKeyIdentifierExtension(node.Data)); }
public AuthorityInfoAccessExtension(byte[] data) { var seq = Asn1Sequence.ReadNode(data); foreach (var node in seq.Nodes) { var mn = (Asn1Sequence)node; var id = (Asn1ObjectIdentifier)mn.Nodes[0]; var cd = (Asn1CustomNode)mn.Nodes[1]; var str = Encoding.UTF8.GetString(cd.Data); Methods.Add(new AuthorityAccessDescription { Url = str }); } }
public static BasicConstraintExtension FromExtensionData(byte[] data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } var seq = Asn1Sequence.ReadNode(data); bool authority = false; ulong?pathLengthConstraint = null; if (seq.Nodes.Count > 0) { authority = ((Asn1Boolean)seq.Nodes[0]).Value; if (seq.Nodes.Count > 1) { pathLengthConstraint = ((Asn1Integer)seq.Nodes[1]).ToUInt64(); } } return(new BasicConstraintExtension { Authority = authority, PathLengthConstraint = pathLengthConstraint }); }