public class SLHDSAKeyFactory extends KeyFactorySpi
KeyFactorySpi
Constructor and Description |
---|
SLHDSAKeyFactory() |
Modifier and Type | Method and Description |
---|---|
protected PrivateKey |
engineGeneratePrivate(KeySpec keySpec)
Generates a private key from the given key spec.
|
protected PublicKey |
engineGeneratePublic(KeySpec keySpec)
Generates a public key from the given key spec.
|
protected <T extends KeySpec> |
engineGetKeySpec(Key key,
Class<T> keySpec)
Implementation of the engine method.
|
protected Key |
engineTranslateKey(Key key)
Translates the given key object of some unknown or untrusted provider into
a key object supported by this SLH-DSA key factory.
|
static Key |
translateKey(Key key) |
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePublic
in class KeyFactorySpi
keySpec
- the key material; it may either be SLHDSAPublicKeySpec
or X509EncodedKeySpec
InvalidKeySpecException
- if the key spec is not supported or erroneousprotected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePrivate
in class KeyFactorySpi
keySpec
- the key material; it may either be SLHDSAPrivateKeySpec
or
PKCS8EncodedKeySpec
InvalidKeySpecException
- if the key spec is not supported or erroneousprotected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
engineGetKeySpec
in class KeyFactorySpi
key
- the key to be converted (either SLHDSAPrivateKey
or
SLHDSAPublicKey
)keySpec
- the key specification type. If the given key is of type
SLHDSAPrivateKey
the keySpec may be SLHDSAPrivateKeySpec
or
PKCS8EncodedKeySpec
.
Otherwise (key is of type
SLHDSAPublicKey
) the keySpec must be
SLHDSAPublicKeySpec
or X509EncodedKeySpec
InvalidKeySpecException
- if the key cannot be transformed into the provided keySpec.protected Key engineTranslateKey(Key key) throws InvalidKeyException
SLHDSAPrivateKey
or SLHDSAPublicKey
.engineTranslateKey
in class KeyFactorySpi
key
- the key to be translatedInvalidKeyException
- if the given key cannot be translatedpublic static Key translateKey(Key key) throws InvalidKeyException
InvalidKeyException
Copyright © 2020–2025 Stiftung SIC. All rights reserved.