Exemple #1
0
        /// <summary>
        /// Load Key pcks7 pem
        /// </summary>
        /// <param name="privateKey"></param>
        public void LoadKey(string privateKey)
        {
            if (privateKey == null)
            {
                throw new ArgumentNullException("privateKey");
            }

            this.keys = OpenSslKey.DecodeOpenSSLPrivateKey(privateKey);
        }
Exemple #2
0
        /// <summary>
        /// Load Key File pcks7 pem
        /// </summary>
        /// <param name="filepath"></param>
        public void LoadKeyFile(string filepath)
        {
            if (filepath == null)
            {
                throw new ArgumentNullException("filepath");
            }

            var privateKey = File.ReadAllText(filepath);

            this.keys = OpenSslKey.DecodeOpenSSLPrivateKey(privateKey);
        }