All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spongycastle.jcajce.spec.PBKDF2KeySpec Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for the Android platform. Android unfortunately ships with a stripped-down version of Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full, up-to-date version of the Bouncy Castle cryptographic libs.

There is a newer version: 1.58.0.0
Show newest version
package org.spongycastle.jcajce.spec;

import javax.crypto.spec.PBEKeySpec;

import org.spongycastle.asn1.x509.AlgorithmIdentifier;

/**
 * Extension of PBEKeySpec which takes into account the PRF algorithm setting available in PKCS#5 PBKDF2.
 */
public class PBKDF2KeySpec
    extends PBEKeySpec
{
    private AlgorithmIdentifier prf;

    /**
     * Base constructor.
     *
     * @param password password to use as the seed of the PBE key generator.
     * @param salt salt to use in the generator,
     * @param iterationCount iteration count to use in the generator.
     * @param keySize size of the key to be generated.
     * @param prf identifier and parameters for the PRF algorithm to use.
     */
    public PBKDF2KeySpec(char[] password, byte[] salt, int iterationCount, int keySize, AlgorithmIdentifier prf)
    {
        super(password, salt, iterationCount, keySize);

        this.prf = prf;
    }

    public AlgorithmIdentifier getPrf()
    {
        return prf;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy