FileDocCategorySizeDatePackage
PBKDF2Params.javaAPI DocAndroid 1.5 API2193Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.pkcs

PBKDF2Params

public class PBKDF2Params extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
org.bouncycastle.asn1.ASN1OctetString
octStr
org.bouncycastle.asn1.DERInteger
iterationCount
org.bouncycastle.asn1.DERInteger
keyLength
Constructors Summary
public PBKDF2Params(byte[] salt, int iterationCount)

        this.octStr = new DEROctetString(salt);
        this.iterationCount = new DERInteger(iterationCount);
    
public PBKDF2Params(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration e = seq.getObjects();

        octStr = (ASN1OctetString)e.nextElement();
        iterationCount = (DERInteger)e.nextElement();

        if (e.hasMoreElements())
        {
            keyLength = (DERInteger)e.nextElement();
        }
        else
        {
            keyLength = null;
        }
    
Methods Summary
public static org.bouncycastle.asn1.pkcs.PBKDF2ParamsgetInstance(java.lang.Object obj)

        if (obj instanceof PBKDF2Params)
        {
            return (PBKDF2Params)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new PBKDF2Params((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public java.math.BigIntegergetIterationCount()

        return iterationCount.getValue();
    
public java.math.BigIntegergetKeyLength()

        if (keyLength != null)
        {
            return keyLength.getValue();
        }

        return null;
    
public byte[]getSalt()

        return octStr.getOctets();
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(octStr);
        v.add(iterationCount);

        if (keyLength != null)
        {
            v.add(keyLength);
        }

        return new DERSequence(v);