override public bool AddSignedCertificate(mx509.X509Certificate cert)
    {
      if(!base.AddSignedCertificate(cert)) {
        return false;
      }

      _local_certificate = MonoX509ToOpenSsl(cert);
      return true;
    }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        override public bool AddSignedCertificate(mx509.X509Certificate cert)
        {
            if (!base.AddSignedCertificate(cert))
            {
                return(false);
            }

            _local_certificate = MonoX509ToOpenSsl(cert);
            return(true);
        }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <summary>
 /// Add an untrusted certificate
 /// </summary>
 /// <param name="cert"></param>
 public void AddUntrusted(X509Certificate cert)
 {
     untrusted.Add(cert);
 }
Esempio n. 7
0
 /// <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));
 }