override public bool AddSignedCertificate(mx509.X509Certificate cert) { if(!base.AddSignedCertificate(cert)) { return false; } _local_certificate = MonoX509ToOpenSsl(cert); return true; }
public static mx509.X509Certificate OpenSslX509ToMonoX509(ox509.X509Certificate cert) { BIO bio = BIO.MemoryBuffer(true); cert.Write(bio); byte[] raw = new byte[bio.BytesPending]; bio.Read(raw, raw.Length); bio.Dispose(); return(new mx509.X509Certificate(raw)); }
override public bool AddSignedCertificate(mx509.X509Certificate cert) { if (!base.AddSignedCertificate(cert)) { return(false); } _local_certificate = MonoX509ToOpenSsl(cert); return(true); }
/// <summary> /// Calls PKCS12_create() with more options /// </summary> /// <param name="password"></param> /// <param name="name">friendly name</param> /// <param name="key"></param> /// <param name="cert"></param> /// <param name="ca"></param> /// <param name="keyPbe">How to encrypt the key</param> /// <param name="certPbe">How to encrypt the certificate</param> /// <param name="iterations"># of iterations during encryption</param> /// <param name="keyType"></param> public PKCS12(string password, string name, CryptoKey key, X509Certificate cert, Stack <X509Certificate> ca, PBE keyPbe, PBE certPbe, int iterations, KeyType keyType) : base(Create(password, name, key, cert, ca, keyPbe, certPbe, iterations, keyType), true) { Init(password); }
/// <summary> /// Calls PKCS12_create() /// </summary> /// <param name="password"></param> /// <param name="key"></param> /// <param name="cert"></param> /// <param name="ca"></param> public PKCS12(string password, CryptoKey key, X509Certificate cert, Stack <X509Certificate> ca) : base(Create(password, null, key, cert, ca, PBE.Default, PBE.Default, 0, KeyType.KEY_DEFAULT), true) { Init(password); }
/// <summary> /// Add an untrusted certificate /// </summary> /// <param name="cert"></param> public void AddUntrusted(X509Certificate cert) { untrusted.Add(cert); }
/// <summary> /// Adds a certificate to the trusted list, calls X509_STORE_add_cert() /// </summary> /// <param name="cert"></param> public void AddTrusted(X509Certificate cert) { // Don't Addref here -- X509_STORE_add_cert increases the refcount of the certificate pointer Native.ExpectSuccess(Native.X509_STORE_add_cert(ptr, cert.Handle)); }