Example #1
0
 private string GetSecretKey()
 {
     if (_certificate == null)
     {
         _certificate = _certificateService.GetCertificate(CertificateName);
     }
     return(_certificate?.GetPublicKeyString());
 }
Example #2
0
        private string DecryptString(string encryptedString, IAppConfiguration appConfiguration)
        {
            var cert = _certificateService.GetCertificate(appConfiguration.EncryptionCertificateSettings);
            var encryptedPasswordAsBytes =
                Convert.FromBase64String(
                    encryptedString.TrimStart(EncryptionPrefix.ToCharArray()));
            var decryptedPasswordAsBytes = cert.GetRSAPrivateKey()
                                           .Decrypt(encryptedPasswordAsBytes, RSAEncryptionPadding.OaepSHA1);

            return(System.Text.Encoding.UTF8.GetString(decryptedPasswordAsBytes));
        }
Example #3
0
 public string GetCertificate(TargetApplication application)
 {
     return(_certificateService.GetCertificate(application));
 }
Example #4
0
 /// <summary>
 /// 获取节点信息
 /// </summary>
 /// <returns></returns>
 public IList <CertificateEntity> GetCertificate()
 {
     return(bll.GetCertificate());
 }
Example #5
0
 public CertificateDTO Get(string txId)
 {
     return(certService.GetCertificate(txId));
 }