Search in sources :

Example 1 with KeyDerivationFunctionFactory

use of org.xwiki.crypto.password.KeyDerivationFunctionFactory in project xwiki-commons by xwiki.

the class DefaultKeyDerivationFunctionFactory method getInstance.

@Override
public KeyDerivationFunction getInstance(byte[] encoded) {
    KeyDerivationFunc func = KeyDerivationFunc.getInstance(ASN1Sequence.getInstance(encoded));
    KeyDerivationFunctionFactory factory = getFactory(func.getAlgorithm().getId());
    KeyDerivationFunction kdf = getBcInstance(factory, func);
    if (kdf == null) {
        kdf = factory.getInstance(encoded);
    }
    return kdf;
}
Also used : KeyDerivationFunction(org.xwiki.crypto.password.KeyDerivationFunction) KeyDerivationFunc(org.bouncycastle.asn1.pkcs.KeyDerivationFunc) KeyDerivationFunctionFactory(org.xwiki.crypto.password.KeyDerivationFunctionFactory)

Aggregations

KeyDerivationFunc (org.bouncycastle.asn1.pkcs.KeyDerivationFunc)1 KeyDerivationFunction (org.xwiki.crypto.password.KeyDerivationFunction)1 KeyDerivationFunctionFactory (org.xwiki.crypto.password.KeyDerivationFunctionFactory)1