Esempio n. 1
0
 public byte[] Export(X509ContentType contentType, SafePasswordHandle password)
 {
     using (IExportPal storePal = StorePal.FromCertificate(this))
     {
         return(storePal.Export(contentType, password));
     }
 }
Esempio n. 2
0
 public byte[] Export(X509ContentType contentType, string password)
 {
     using (IExportPal storePal = StorePal.LinkFromCertificateCollection(this))
     {
         return(storePal.Export(contentType, password));
     }
 }
 public byte[]? Export(X509ContentType contentType, string?password)
 {
     using (var safePasswordHandle = new SafePasswordHandle(password))
         using (IExportPal storePal = StorePal.LinkFromCertificateCollection(this))
         {
             return(storePal.Export(contentType, safePasswordHandle));
         }
 }
Esempio n. 4
0
 public byte[] Export(X509ContentType contentType, SafePasswordHandle password)
 {
     using (IExportPal storePal = StorePal.FromCertificate(this))
     {
         byte[]? exported = storePal.Export(contentType, password);
         Debug.Assert(exported != null);
         return(exported);
     }
 }
Esempio n. 5
0
        public virtual byte[] Export(X509ContentType contentType, SecureString password)
        {
            VerifyContentType(contentType);

            if (Pal == null)
            {
                throw new CryptographicException(ErrorCode.E_POINTER);  // Not the greatest error, but needed for backward compat.
            }
            using (var safePasswordHandle = new SafePasswordHandle(password))
                using (IExportPal storePal = StorePal.FromCertificate(Pal))
                {
                    return(storePal.Export(contentType, safePasswordHandle));
                }
        }
Esempio n. 6
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 (IExportPal storePal = StorePal.FromCertificate(Pal))
            {
                return(storePal.Export(contentType, password));
            }
        }