void initializeAsn1(Byte[] bytes)
        {
            switch (PropertyName)
            {
            case X509CertificatePropertyType.EnhancedKeyUsage:
                UnderlyingType = typeof(X509EnhancedKeyUsageExtension);
                AsnEncodedData asn = new AsnEncodedData(bytes);
                PropertyValue = new X509EnhancedKeyUsageExtension(asn, false);
                break;

            case X509CertificatePropertyType.RootProgramCertificatePolicies:
                UnderlyingType = typeof(X509CertificatePoliciesExtension);
                PropertyValue  = new X509CertificatePoliciesExtension(bytes, false);
                break;

            case X509CertificatePropertyType.OcspResponse:
                UnderlyingType = typeof(OCSPResponse);
                PropertyValue  = new OCSPResponse(bytes);
                break;

            case X509CertificatePropertyType.CrossCertificateDistributionPoints:
            case X509CertificatePropertyType.CTLNextUpdateLocation:
                UnderlyingType = typeof(X509AlternativeNameCollection);
                PropertyValue  = new X509AlternativeNameCollection();
                ((X509AlternativeNameCollection)PropertyValue).Decode(bytes);
                ((X509AlternativeNameCollection)PropertyValue).Close();
                break;
            }
        }
    public static DateTime?GetrevocationDate(X509Certificate2 cert)
    {
        OCSPRequest  request  = new OCSPRequest(cert);
        OCSPResponse response = request.SendRequest();

        if (response.Responses[0].CertStatus == CertificateStatus.Revoked)
        {
            return(response.Responses[0].RevocationInfo.RevocationDate);
        }
        return(null);
    }
Esempio n. 3
0
 public OCSPResp(Stream stream)
 {
     this.resp = OCSPResponse.getInstance(new ASN1InputStream(stream).readObject());
 }
Esempio n. 4
0
 public OCSPResp(OCSPResponse resp)
 {
     this.resp = resp;
 }