internal static KerberosHostAddress Parse(DERValue value) { if (!value.CheckSequence()) { throw new InvalidDataException(); } KerberosHostAddressType type = 0; byte[] data = null; foreach (var next in value.Children) { if (next.Type != DERTagType.ContextSpecific) { throw new InvalidDataException(); } switch (next.Tag) { case 0: type = (KerberosHostAddressType)next.ReadChildInteger(); break; case 1: data = next.ReadChildOctetString(); break; default: throw new InvalidDataException(); } } if (type == 0 || data == null) { throw new InvalidDataException(); } return(new KerberosHostAddress(type, data)); }
private KerberosHostAddress(KerberosHostAddressType type, byte[] address) { AddressType = type; Address = address; }