Search in sources :

Example 1 with KeyFactory

use of de.flexiprovider.api.keys.KeyFactory in project core by jcryptool.

the class AbstractKeyNodeContentProvider method getKeySpec.

protected KeySpec getKeySpec(Key key) {
    try {
        KeyFactory keyFactory = Registry.getKeyFactory(key.getAlgorithm());
        KeySpec keySpec = keyFactory.getKeySpec(key, AlgorithmParameterSpec.class);
        return keySpec;
    } catch (NoSuchAlgorithmException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
}
Also used : KeySpec(de.flexiprovider.api.keys.KeySpec) NoSuchAlgorithmException(de.flexiprovider.api.exceptions.NoSuchAlgorithmException) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) KeyFactory(de.flexiprovider.api.keys.KeyFactory)

Aggregations

InvalidKeySpecException (de.flexiprovider.api.exceptions.InvalidKeySpecException)1 NoSuchAlgorithmException (de.flexiprovider.api.exceptions.NoSuchAlgorithmException)1 KeyFactory (de.flexiprovider.api.keys.KeyFactory)1 KeySpec (de.flexiprovider.api.keys.KeySpec)1