Ejemplo n.º 1
0
 public static X509Certificate2 CreateCertificate2(byte[] data, string password, bool disallowFallback = false)
 {
     using (var impl = new X509CertificateImplBtls(disallowFallback)) {
         impl.Import(data, password, X509KeyStorageFlags.DefaultKeySet);
         return(new X509Certificate2(impl));
     }
 }
Ejemplo n.º 2
0
        internal override X509Certificate2Impl GetNativeCertificate(
            byte[] data, string password, X509KeyStorageFlags flags)
        {
            var impl = new X509CertificateImplBtls(false);

            impl.Import(data, password, flags);
            return(impl);
        }
Ejemplo n.º 3
0
        internal X509Certificate2Impl GetNativeCertificate(
            byte[] data, SafePasswordHandle password, X509KeyStorageFlags flags)
        {
            var impl = new X509CertificateImplBtls(false);

            impl.Import(data, password, flags);
            return(impl);
        }
Ejemplo n.º 4
0
        static X509CertificateImplBtls GetPrivateCertificate(X509Certificate certificate)
        {
            var impl = certificate.Impl as X509CertificateImplBtls;

            if (impl != null)
            {
                return((X509CertificateImplBtls)impl.Clone());
            }

            var password = Guid.NewGuid().ToString();
            var buffer   = certificate.Export(X509ContentType.Pfx, password);

            impl = new X509CertificateImplBtls();
            impl.Import(buffer, password, X509KeyStorageFlags.DefaultKeySet);
            return(impl);
        }
Ejemplo n.º 5
0
		internal override X509Certificate2Impl GetNativeCertificate (
			byte[] data, string password, X509KeyStorageFlags flags)
		{
			var impl = new X509CertificateImplBtls (false);
			impl.Import (data, password, flags);
			return impl;
		}
Ejemplo n.º 6
0
		public static X509Certificate2 CreateCertificate2 (byte[] data, string password, bool disallowFallback = false)
		{
			using (var impl = new X509CertificateImplBtls (disallowFallback)) {
				impl.Import (data, password, X509KeyStorageFlags.DefaultKeySet);
				return new X509Certificate2 (impl);
			}
		}