Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
            }
Beispiel #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;
        }
Beispiel #5
0
        internal A CreateBuilder <A>(IBuilderServiceType <A> type)
        {
            CryptoStatus.IsReady();

            return((type as IBuilderService <A>).GetFunc(this).Invoke(type as IParameters <Algorithm>));
        }
Beispiel #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));
        }
Beispiel #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)));
        }
Beispiel #8
0
        internal A CreateService <A>(ICryptoServiceType <A> type, IAsymmetricKey key)
        {
            CryptoStatus.IsReady();

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

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