예제 #1
0
        static SslInitializer()
        {
            CryptoInitializer.Initialize();

            //Call ssl specific initializer
            Ssl.EnsureLibSslInitialized();
        }
예제 #2
0
        static SslInitializer()
        {
            CryptoInitializer.Initialize();

            //Call ssl specific initializer
            SSL_library_init();
            SSL_load_error_strings();
        }
        static HttpInitializer()
        {
            // CURL uses OpenSSL which me must initialize first to guarantee thread-safety
            CryptoInitializer.Initialize();

            if (EnsureCurlIsInitialized() != 0)
            {
                throw new InvalidOperationException();
            }
        }
        static SslInitializer()
        {
            CryptoInitializer.Initialize();

            //Call ssl specific initializer
            Ssl.EnsureLibSslInitialized();
            if (Interop.Crypto.ErrPeekLastError() != 0)
            {
                // It is going to be wrapped in a type load exception but will have the error information
                throw Interop.Crypto.CreateOpenSslCryptographicException();
            }
        }
예제 #5
0
        static HttpInitializer()
        {
#if !SYSNETHTTP_NO_OPENSSL
            // CURL uses OpenSSL which me must initialize first to guarantee thread-safety
            CryptoInitializer.Initialize();
#endif

            if (EnsureCurlIsInitialized() != 0)
            {
                throw new InvalidOperationException();
            }
        }
예제 #6
0
        public IEnumerator InitCrypto()
        {
            UseWebSocket?useWebSocket = this.useWebSocket;

            if (useWebSocket.HasValue)
            {
                Logger.Warn("InitCrypto method not supported in WebSocket mode; use WSS protocol instead");
                return(null);
            }
            CryptoInitializer cryptoInitializer = new CryptoInitializer(this);

            return(cryptoInitializer.Run());
        }
예제 #7
0
        static HttpInitializer()
        {
#if !SYSNETHTTP_NO_OPENSSL
            string opensslVersion = Interop.Http.GetSslVersionDescription();
            if (string.IsNullOrEmpty(opensslVersion) ||
                opensslVersion.IndexOf(Interop.Http.OpenSsl10Description, StringComparison.OrdinalIgnoreCase) != -1)
            {
                // CURL uses OpenSSL which me must initialize first to guarantee thread-safety
                // Only initialize for OpenSSL/1.0, any newer versions may have mismatched
                // pointers, resulting in segfaults.
                CryptoInitializer.Initialize();
            }
#endif

            if (EnsureCurlIsInitialized() != 0)
            {
                throw new InvalidOperationException();
            }
        }
예제 #8
0
        static HttpInitializer()
        {
#if !SYSNETHTTP_NO_OPENSSL
            string opensslVersion = Interop.Http.GetSslVersionDescription();
            if (string.IsNullOrEmpty(opensslVersion) ||
                opensslVersion.IndexOf(Interop.Http.OpenSslDescriptionPrefix, StringComparison.OrdinalIgnoreCase) != -1)
            {
                // CURL uses OpenSSL which we must initialize first to guarantee thread-safety.
                // We'll wake up whatever OpenSSL we're going to run against, but might later determine that
                // they aren't compatible.
                CryptoInitializer.Initialize();
            }
#endif

            if (EnsureCurlIsInitialized() != 0)
            {
                throw new InvalidOperationException();
            }
        }
 static Crypto()
 {
     CryptoInitializer.Initialize();
 }
예제 #10
0
 static OpenSsl()
 {
     CryptoInitializer.Initialize();
 }
예제 #11
0
 static libcrypto()
 {
     CryptoInitializer.Initialize();
 }
예제 #12
0
파일: KeyMan.cs 프로젝트: modulexcite/Tiket
 /// <summary>
 /// Initializes the key manager using the specified key. A new key can be generated by calling <seealso cref="GenerateKey"/>.
 /// </summary>
 public KeyMan(string key)
 {
     _cryptoServiceProvider = CryptoInitializer.GetFromKey(key);
 }
예제 #13
0
파일: KeyMan.cs 프로젝트: modulexcite/Tiket
 /// <summary>
 /// Generates a new key, which includes both public and private keys
 /// </summary>
 public static string GenerateKey()
 {
     return(CryptoInitializer.GenerateNewKey());
 }
예제 #14
0
파일: KeyMan.cs 프로젝트: rebus-org/Tiket
 /// <summary>
 /// Generates a new key, which includes both public and private keys
 /// </summary>
 public static string GenerateKey() => CryptoInitializer.GenerateNewKey();