Search in sources :

Example 1 with AbstractBcKDF

use of org.xwiki.crypto.password.internal.kdf.AbstractBcKDF in project xwiki-commons by xwiki.

the class AbstractBcPBES2Cipher method getPBEParameters.

@Override
public AlgorithmIdentifier getPBEParameters() throws IOException {
    KeyDerivationFunc kdfParams;
    if (getKeyDerivationFunction() instanceof AbstractBcKDF) {
        kdfParams = ((AbstractBcKDF) getKeyDerivationFunction()).getKeyDerivationFunction();
    } else {
        kdfParams = KeyDerivationFunc.getInstance(getKeyDerivationFunction().getEncoded());
    }
    EncryptionScheme scheme = getScheme(getParameters());
    return new AlgorithmIdentifier(PKCSObjectIdentifiers.id_PBES2, new PBES2Parameters(kdfParams, scheme));
}
Also used : PBES2Parameters(org.xwiki.crypto.password.internal.kdf.PBES2Parameters) EncryptionScheme(org.bouncycastle.asn1.pkcs.EncryptionScheme) KeyDerivationFunc(org.bouncycastle.asn1.pkcs.KeyDerivationFunc) AbstractBcKDF(org.xwiki.crypto.password.internal.kdf.AbstractBcKDF) AlgorithmIdentifier(org.bouncycastle.asn1.x509.AlgorithmIdentifier)

Aggregations

EncryptionScheme (org.bouncycastle.asn1.pkcs.EncryptionScheme)1 KeyDerivationFunc (org.bouncycastle.asn1.pkcs.KeyDerivationFunc)1 AlgorithmIdentifier (org.bouncycastle.asn1.x509.AlgorithmIdentifier)1 AbstractBcKDF (org.xwiki.crypto.password.internal.kdf.AbstractBcKDF)1 PBES2Parameters (org.xwiki.crypto.password.internal.kdf.PBES2Parameters)1