コード例 #1
0
 public AsymmetricInMemoryCryptoService(AsymmetricCryptoServiceOptions options) : base(options)
 {
     if (Options.AssignNewKey)
     {
         AssignNewKey();
     }
 }
コード例 #2
0
        public AsymmetricXmlCryptoService(AsymmetricCryptoServiceOptions options) : base(options)
        {
            if (string.IsNullOrEmpty(Options.XmlPublicKeyFilePath))
            {
                throw new ArgumentException($"{nameof(Options.XmlPublicKeyFilePath)} cannot be null or empty");
            }

            if (string.IsNullOrEmpty(Options.XmlPrivateKeyFilePath))
            {
                throw new ArgumentException($"{nameof(Options.XmlPrivateKeyFilePath)} cannot be null or empty");
            }

            if (Options.AssignNewKey)
            {
                AssignNewKey();
            }
        }
コード例 #3
0
        public AsymmetricCspCryptoService(AsymmetricCryptoServiceOptions options) : base(options)
        {
            if (options.CspParameters == null)
            {
                throw new ArgumentException($"{nameof(options.CspParameters)} cannot be null or empty");
            }

            if (string.IsNullOrEmpty(options.CspParameters.KeyContainerName))
            {
                throw new ArgumentException($"{nameof(options.CspParameters.KeyContainerName)} cannot be null or empty");
            }

            if (Options.AssignNewKey)
            {
                AssignNewKey();
            }
        }
コード例 #4
0
 protected AsymmetricCryptoServiceBase(AsymmetricCryptoServiceOptions options)
 {
     Options = options;
 }
コード例 #5
0
 public static AsymmetricCryptoServiceBuilder WithOptions(this AsymmetricCryptoServiceBuilder builder, AsymmetricCryptoServiceOptions options)
 {
     builder.Options = options;
     return(builder);
 }