コード例 #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());
        }
コード例 #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);
        }
コード例 #3
0
 /// <exception cref="IOException"></exception>
 public static void AddStatusRequestExtension(IDictionary extensions, CertificateStatusRequest statusRequest)
 {
     extensions[ExtensionType.status_request] = CreateStatusRequestExtension(statusRequest);
 }