Example #1
0
        internal static MonoBtlsX509 CertStoreLookup(MonoBtlsX509Name name)
        {
            var hash    = name.GetHash();
            var hashOld = name.GetHashOld();
            var result  = certStoreLookup(hash, false);

            if (result == null)
            {
                result = certStoreLookup(hashOld, false);
            }
            if (result == null)
            {
                result = certStoreLookup(hash, true);
            }
            if (result == null)
            {
                result = certStoreLookup(hashOld, true);
            }

            if (result == null)
            {
                return(null);
            }

            return(MonoBtlsX509.LoadFromData(result, MonoBtlsX509Format.DER));
        }
        static MonoBtlsX509 GetNativeInstance(X509CertificateImpl impl)
        {
            ThrowIfContextInvalid(impl);
            var btlsImpl = impl as X509CertificateImplBtls;

            if (btlsImpl != null)
            {
                return(btlsImpl.X509.Copy());
            }
            else
            {
                return(MonoBtlsX509.LoadFromData(impl.GetRawCertData(), MonoBtlsX509Format.DER));
            }
        }
Example #3
0
        public static BtlsX509 CreateNative(byte[] data, BtlsX509Format format)
        {
            var x509 = MonoBtlsX509.LoadFromData(data, (MonoBtlsX509Format)format);

            return(new BtlsX509(x509));
        }