예제 #1
0
파일: DKIM.cs 프로젝트: aooshi/adf
        /// <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);
        }
예제 #2
0
파일: DKIM.cs 프로젝트: aooshi/adf
        private byte[] Sign(byte[] data)
        {
            using (var rsa = OpenSslKey.DecodeRSAPrivateKey(this.keys))
            {
                byte[] signature = rsa.SignData(data, this.GetAlgorithmName());

                return(signature);
            }
        }
예제 #3
0
파일: DKIM.cs 프로젝트: aooshi/adf
        /// <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);
        }