예제 #1
0
 internal HMacDRBGProvider(FipsDigestAlgorithm algorithm, byte[] nonce, byte[] personalizationString, int securityStrength, byte[] primaryAdditionalInput)
 {
     CryptoStatus.IsReady();
     this.hMac  = FipsShs.CreateHmac(algorithm);
     this.nonce = nonce;
     this.personalizationString  = personalizationString;
     this.securityStrength       = securityStrength;
     this.primaryAdditionalInput = primaryAdditionalInput;
 }
예제 #2
0
 public CTRDRBGProvider(Org.BouncyCastle.Crypto.Internal.IBlockCipher blockCipher, int keySizeInBits, byte[] nonce, byte[] personalizationString, int securityStrength, byte[] primaryAdditionalInput)
 {
     CryptoStatus.IsReady();
     this.blockCipher            = blockCipher;
     this.keySizeInBits          = keySizeInBits;
     this.nonce                  = nonce;
     this.personalizationString  = personalizationString;
     this.securityStrength       = securityStrength;
     this.primaryAdditionalInput = primaryAdditionalInput;
 }
예제 #3
0
            internal Builder(FipsAlgorithm algorithm, FipsDigestAlgorithm digestAlg, Variations variation, SecureRandom random, IEntropySourceProvider entropySourceProvider)
            {
                CryptoStatus.IsReady();

                this.algorithm             = algorithm;
                this.digestAlg             = digestAlg;
                this.variation             = variation;
                this.random                = random;
                this.entropySourceProvider = entropySourceProvider;
            }
예제 #4
0
        internal GeneralBlockCipherProvider(string name, IEngineProvider <Internal.IBlockCipher> engineProvider)
        {
            CryptoStatus.IsReady();

            if (CryptoServicesRegistrar.IsInApprovedOnlyMode())
            {
                throw new CryptoUnapprovedOperationError("Attempt to create provider for unapproved algorithm in approved only mode");
            }

            this.name           = name;
            this.engineProvider = engineProvider;
        }
예제 #5
0
        internal A CreateBuilder <A>(IBuilderServiceType <A> type)
        {
            CryptoStatus.IsReady();

            return((type as IBuilderService <A>).GetFunc(this).Invoke(type as IParameters <Algorithm>));
        }
예제 #6
0
        internal A CreateGenerator <A>(IGenerationServiceType <A> type, SecureRandom random)
        {
            CryptoStatus.IsReady();

            return((type as IGenerationService <A>).GetFunc(this).Invoke(type as IParameters <Algorithm>, random));
        }
예제 #7
0
        internal A CreateService <A>(ICryptoServiceType <A> type, IAsymmetricKey key, SecureRandom random)
        {
            CryptoStatus.IsReady();

            return((type as IServiceProvider <A>).GetFunc(this).Invoke(new KeyWithRandom(key, random)));
        }
예제 #8
0
        internal A CreateService <A>(ICryptoServiceType <A> type, IAsymmetricKey key)
        {
            CryptoStatus.IsReady();

            return((type as IServiceProvider <A>).GetFunc(this).Invoke(key));
        }
예제 #9
0
        internal A CreateService <A>(ICryptoServiceType <A> type)
        {
            CryptoStatus.IsReady();

            return((type as IServiceProvider <A>).GetFunc(this).Invoke((IKey)type));
        }