Ejemplo n.º 1
0
        /// <exception cref="IOException"></exception>
        public static byte[] CreateStatusRequestExtension(CertificateStatusRequest statusRequest)
        {
            if (statusRequest == null)
            {
                throw new TlsFatalAlert(AlertDescription.internal_error);
            }

            MemoryStream buf = new MemoryStream();

            statusRequest.Encode(buf);

            return(buf.ToArray());
        }
Ejemplo n.º 2
0
        /// <exception cref="IOException"></exception>
        public static CertificateStatusRequest ReadStatusRequestExtension(byte[] extensionData)
        {
            if (extensionData == null)
            {
                throw new ArgumentNullException("extensionData");
            }

            MemoryStream buf = new MemoryStream(extensionData, false);

            CertificateStatusRequest statusRequest = CertificateStatusRequest.Parse(buf);

            TlsProtocol.AssertEmpty(buf);

            return(statusRequest);
        }
Ejemplo n.º 3
0
 /// <exception cref="IOException"></exception>
 public static void AddStatusRequestExtension(IDictionary extensions, CertificateStatusRequest statusRequest)
 {
     extensions[ExtensionType.status_request] = CreateStatusRequestExtension(statusRequest);
 }