FileDocCategorySizeDatePackage
JCEPBEKey.javaAPI DocAndroid 1.5 API3329Wed May 06 22:41:06 BST 2009org.bouncycastle.jce.provider

JCEPBEKey

public class JCEPBEKey extends Object implements PBEKey

Fields Summary
String
algorithm
org.bouncycastle.asn1.DERObjectIdentifier
oid
int
type
int
digest
int
keySize
int
ivSize
org.bouncycastle.crypto.CipherParameters
param
PBEKeySpec
pbeKeySpec
boolean
tryWrong
Constructors Summary
public JCEPBEKey(String algorithm, org.bouncycastle.asn1.DERObjectIdentifier oid, int type, int digest, int keySize, int ivSize, PBEKeySpec pbeKeySpec, org.bouncycastle.crypto.CipherParameters param)

param
param


           
     
                      
         
                         
                         
                         
                         
                  
            
    
        this.algorithm = algorithm;
        this.oid = oid;
        this.type = type;
        this.digest = digest;
        this.keySize = keySize;
        this.ivSize = ivSize;
        this.pbeKeySpec = pbeKeySpec;
        this.param = param;
    
Methods Summary
public java.lang.StringgetAlgorithm()

        return algorithm;
    
intgetDigest()

        return digest;
    
public byte[]getEncoded()

        if (param != null)
        {
            KeyParameter    kParam;
            
            if (param instanceof ParametersWithIV)
            {
                kParam = (KeyParameter)((ParametersWithIV)param).getParameters();
            }
            else
            {
                kParam = (KeyParameter)param;
            }
            
            return kParam.getKey();
        }
        else
        {
            if (type == PBE.PKCS12)
            {
                return PBEParametersGenerator.PKCS12PasswordToBytes(pbeKeySpec.getPassword());
            }
            else
            {   
                return PBEParametersGenerator.PKCS5PasswordToBytes(pbeKeySpec.getPassword());
            }
        }
    
public java.lang.StringgetFormat()

        return "RAW";
    
public intgetIterationCount()

        return pbeKeySpec.getIterationCount();
    
intgetIvSize()

        return ivSize;
    
intgetKeySize()

        return keySize;
    
public org.bouncycastle.asn1.DERObjectIdentifiergetOID()

        return oid;
    
org.bouncycastle.crypto.CipherParametersgetParam()

        return param;
    
public char[]getPassword()

        return pbeKeySpec.getPassword();
    
public byte[]getSalt()

        return pbeKeySpec.getSalt();
    
intgetType()

        return type;
    
voidsetTryWrongPKCS12Zero(boolean tryWrong)

        this.tryWrong = tryWrong; 
    
booleanshouldTryWrongPKCS12()

        return tryWrong;