Ejemplo n.º 1
0
 public byte[] Export(X509ContentType contentType, String password)
 {
     using (IStorePal storePal = StorePal.LinkFromCertificateCollection(this))
     {
         return(storePal.Export(contentType, password));
     }
 }
Ejemplo n.º 2
0
        public virtual byte[] Export(X509ContentType contentType, String password)
        {
            if (!(contentType == X509ContentType.Cert || contentType == X509ContentType.SerializedCert || contentType == X509ContentType.Pkcs12))
            {
                throw new CryptographicException(SR.Cryptography_X509_InvalidContentType);
            }

            if (Pal == null)
            {
                throw new CryptographicException(ErrorCode.E_POINTER);  // Not the greatest error, but needed for backward compat.
            }
            using (IStorePal storePal = StorePal.FromCertificate(Pal))
            {
                return(storePal.Export(contentType, password));
            }
        }