/** * Parse a {@link CertificateUrl} from a {@link Stream}. * * @param context * the {@link TlsContext} of the current connection. * @param input * the {@link Stream} to parse from. * @return a {@link CertificateUrl} object. * @throws IOException */ public static CertificateUrl parse(TlsContext context, Stream input) { byte type = TlsUtilities.ReadUint8(input); if (!CertChainType.IsValid(type)) { throw new TlsFatalAlert(AlertDescription.decode_error); } int totalLength = TlsUtilities.ReadUint16(input); if (totalLength < 1) { throw new TlsFatalAlert(AlertDescription.decode_error); } byte[] urlAndHashListData = TlsUtilities.ReadFully(totalLength, input); MemoryStream buf = new MemoryStream(urlAndHashListData, false); IList url_and_hash_list = Platform.CreateArrayList(); while (buf.Position < buf.Length) { UrlAndHash url_and_hash = UrlAndHash.Parse(context, buf); url_and_hash_list.Add(url_and_hash); } return(new CertificateUrl(type, url_and_hash_list)); }
public static CertificateUrl parse(TlsContext context, Stream input) { byte b = TlsUtilities.ReadUint8(input); if (!CertChainType.IsValid(b)) { throw new TlsFatalAlert(50); } int num = TlsUtilities.ReadUint16(input); if (num < 1) { throw new TlsFatalAlert(50); } byte[] buffer = TlsUtilities.ReadFully(num, input); MemoryStream memoryStream = new MemoryStream(buffer, false); IList list = Platform.CreateArrayList(); while (memoryStream.Position < memoryStream.Length) { UrlAndHash value = UrlAndHash.Parse(context, memoryStream); list.Add(value); } return(new CertificateUrl(b, list)); }
public static CertificateUrl parse(TlsContext context, Stream input) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown byte b = TlsUtilities.ReadUint8(input); if (!CertChainType.IsValid(b)) { throw new TlsFatalAlert(50); } int num = TlsUtilities.ReadUint16(input); if (num < 1) { throw new TlsFatalAlert(50); } byte[] array = TlsUtilities.ReadFully(num, input); MemoryStream val = new MemoryStream(array, false); global::System.Collections.IList list = Platform.CreateArrayList(); while (((Stream)val).get_Position() < ((Stream)val).get_Length()) { UrlAndHash urlAndHash = UrlAndHash.Parse(context, (Stream)(object)val); list.Add((object)urlAndHash); } return(new CertificateUrl(b, list)); }
public CertificateUrl(byte type, IList urlAndHashList) { if (!CertChainType.IsValid(type)) { throw new ArgumentException("not a valid CertChainType value", "type"); } if (urlAndHashList == null || urlAndHashList.Count < 1) { throw new ArgumentException("must have length > 0", "urlAndHashList"); } this.mType = type; this.mUrlAndHashList = urlAndHashList; }
public CertificateUrl(byte type, global::System.Collections.IList urlAndHashList) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!CertChainType.IsValid(type)) { throw new ArgumentException("not a valid CertChainType value", "type"); } if (urlAndHashList == null || ((global::System.Collections.ICollection)urlAndHashList).get_Count() < 1) { throw new ArgumentException("must have length > 0", "urlAndHashList"); } mType = type; mUrlAndHashList = urlAndHashList; }