public byte[] GetEncoded()
 {
     byte[] derEncoded;
     try
     {
         X509CertificateStructure x509CertificateStructure  = null;
         X509CertificateStructure x509CertificateStructure2 = null;
         if (this.forward != null)
         {
             x509CertificateStructure = X509CertificateStructure.GetInstance(Asn1Object.FromByteArray(this.forward.GetEncoded()));
             if (x509CertificateStructure == null)
             {
                 throw new CertificateEncodingException("unable to get encoding for forward");
             }
         }
         if (this.reverse != null)
         {
             x509CertificateStructure2 = X509CertificateStructure.GetInstance(Asn1Object.FromByteArray(this.reverse.GetEncoded()));
             if (x509CertificateStructure2 == null)
             {
                 throw new CertificateEncodingException("unable to get encoding for reverse");
             }
         }
         derEncoded = new CertificatePair(x509CertificateStructure, x509CertificateStructure2).GetDerEncoded();
     }
     catch (Exception ex)
     {
         throw new CertificateEncodingException(ex.Message, ex);
     }
     return(derEncoded);
 }
Exemplo n.º 2
0
        private X509CertificatePair ReadDerCrossCertificatePair(Stream inStream)
        {
            Asn1InputStream asn1InputStream = new Asn1InputStream(inStream);
            Asn1Sequence    obj             = (Asn1Sequence)asn1InputStream.ReadObject();
            CertificatePair instance        = CertificatePair.GetInstance(obj);

            return(new X509CertificatePair(instance));
        }
Exemplo n.º 3
0
        private X509CertificatePair ReadDerCrossCertificatePair(
            Stream inStream)
        {
            Asn1InputStream dIn  = new Asn1InputStream(inStream);           //, ProviderUtil.getReadLimit(in));
            Asn1Sequence    seq  = (Asn1Sequence)dIn.ReadObject();
            CertificatePair pair = CertificatePair.GetInstance(seq);

            return(new X509CertificatePair(pair));
        }
Exemplo n.º 4
0
 public X509CertificatePair(CertificatePair pair)
 {
     if (pair.Forward != null)
     {
         forward = new X509Certificate(pair.Forward);
     }
     if (pair.Reverse != null)
     {
         reverse = new X509Certificate(pair.Reverse);
     }
 }