public static IAsymmetricProvider Create(AsymmetricProviderType providerType = AsymmetricProviderType.RSA)
        {
            switch (providerType)
            {
            case AsymmetricProviderType.RSA:
                return(new RSAEncryption());

            case AsymmetricProviderType.RSA2:
                return(new RSA2Encryption());

            case AsymmetricProviderType.SM2:
                return(new SM2Encryption());

            default:
                return(new RSAEncryption());
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 创建非对称加密提供程序
 /// </summary>
 /// <param name="providerType"></param>
 /// <returns></returns>
 public static IAsymmetricProvider CreateAsymmetric(AsymmetricProviderType providerType = AsymmetricProviderType.RSA)
 {
     return(AsymmetricProviderFactory.Create(providerType));
 }