Bouncy Castle Cryptography Library 1.87

org.bouncycastle.jcajce.provider.symmetric.util
Class PBE.Util

java.lang.Object
  extended byorg.bouncycastle.jcajce.provider.symmetric.util.PBE.Util
Enclosing class:
PBE

public static class PBE.Util
extends java.lang.Object

uses the appropriate mixer to generate the key and IV if necessary.


Constructor Summary
PBE.Util()
           
 
Method Summary
static AlgorithmIdentifier getPRF(int digest)
          Return the PBKDF2 PRF for a digest code, or null if there is none.
static int getPRFDigest(ASN1ObjectIdentifier prf)
          Return the digest code for a PBKDF2 PRF, or -1 if the PRF is not supported.
static CipherParameters makePBEMacParameters(BCPBEKey pbeKey, java.security.spec.AlgorithmParameterSpec spec)
          generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.
static CipherParameters makePBEMacParameters(javax.crypto.spec.PBEKeySpec keySpec, int type, int hash, int keySize)
          generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.
static CipherParameters makePBEMacParameters(javax.crypto.SecretKey key, int type, int hash, int keySize, javax.crypto.spec.PBEParameterSpec pbeSpec)
          generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.
static CipherParameters makePBEParameters(BCPBEKey pbeKey, java.security.spec.AlgorithmParameterSpec spec, java.lang.String targetAlgorithm)
          construct a key and iv (if necessary) suitable for use with a Cipher.
static CipherParameters makePBEParameters(byte[] pbeKey, int scheme, int digest, int keySize, int ivSize, java.security.spec.AlgorithmParameterSpec spec, java.lang.String targetAlgorithm)
          construct a key and iv (if necessary) suitable for use with a Cipher.
static CipherParameters makePBEParameters(javax.crypto.spec.PBEKeySpec keySpec, int type, int hash, int keySize, int ivSize)
          construct a key and iv (if necessary) suitable for use with a Cipher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBE.Util

public PBE.Util()
Method Detail

getPRFDigest

public static int getPRFDigest(ASN1ObjectIdentifier prf)
Return the digest code for a PBKDF2 PRF, or -1 if the PRF is not supported.


getPRF

public static AlgorithmIdentifier getPRF(int digest)
Return the PBKDF2 PRF for a digest code, or null if there is none.


makePBEParameters

public static CipherParameters makePBEParameters(byte[] pbeKey,
                                                 int scheme,
                                                 int digest,
                                                 int keySize,
                                                 int ivSize,
                                                 java.security.spec.AlgorithmParameterSpec spec,
                                                 java.lang.String targetAlgorithm)
                                          throws java.security.InvalidAlgorithmParameterException
construct a key and iv (if necessary) suitable for use with a Cipher.

Throws:
java.security.InvalidAlgorithmParameterException

makePBEParameters

public static CipherParameters makePBEParameters(BCPBEKey pbeKey,
                                                 java.security.spec.AlgorithmParameterSpec spec,
                                                 java.lang.String targetAlgorithm)
construct a key and iv (if necessary) suitable for use with a Cipher.


makePBEMacParameters

public static CipherParameters makePBEMacParameters(BCPBEKey pbeKey,
                                                    java.security.spec.AlgorithmParameterSpec spec)
generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.


makePBEMacParameters

public static CipherParameters makePBEMacParameters(javax.crypto.spec.PBEKeySpec keySpec,
                                                    int type,
                                                    int hash,
                                                    int keySize)
generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.


makePBEParameters

public static CipherParameters makePBEParameters(javax.crypto.spec.PBEKeySpec keySpec,
                                                 int type,
                                                 int hash,
                                                 int keySize,
                                                 int ivSize)
construct a key and iv (if necessary) suitable for use with a Cipher.


makePBEMacParameters

public static CipherParameters makePBEMacParameters(javax.crypto.SecretKey key,
                                                    int type,
                                                    int hash,
                                                    int keySize,
                                                    javax.crypto.spec.PBEParameterSpec pbeSpec)
generate a PBE based key suitable for a MAC algorithm, the key size is chosen according the MAC size, or the hashing algorithm, whichever is greater.


Bouncy Castle Cryptography Library 1.87