예제 #1
0
 public byte[] Export(X509ContentType contentType, SafePasswordHandle password)
 {
     using (IExportPal storePal = StorePal.FromCertificate(this))
     {
         return(storePal.Export(contentType, password));
     }
 }
예제 #2
0
 public byte[] Export(X509ContentType contentType, string password)
 {
     using (IExportPal storePal = StorePal.LinkFromCertificateCollection(this))
     {
         return(storePal.Export(contentType, password));
     }
 }
예제 #3
0
 public byte[]? Export(X509ContentType contentType, string?password)
 {
     using (var safePasswordHandle = new SafePasswordHandle(password))
         using (IExportPal storePal = StorePal.LinkFromCertificateCollection(this))
         {
             return(storePal.Export(contentType, safePasswordHandle));
         }
 }
예제 #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);
     }
 }
예제 #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));
                }
        }
예제 #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));
            }
        }