示例#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));
     }
 }
 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));
            }
        }