public class KeyFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
KeyFactory(KeyFactorySpi keyFacSpi,
Provider provider,
String algorithm) |
Modifier and Type | Method and Description |
---|---|
PrivateKey |
generatePrivate(KeySpec keySpec) |
PublicKey |
generatePublic(KeySpec keySpec) |
String |
getAlgorithm() |
static KeyFactory |
getInstance(String algorithm) |
static KeyFactory |
getInstance(String algorithm,
Provider provider) |
static KeyFactory |
getInstance(String algorithm,
String provider) |
KeySpec |
getKeySpec(Key key,
Class keySpec) |
Provider |
getProvider() |
Key |
translateKey(Key key) |
protected KeyFactory(KeyFactorySpi keyFacSpi, Provider provider, String algorithm)
public static KeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static KeyFactory getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
public static KeyFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public final PrivateKey generatePrivate(KeySpec keySpec) throws InvalidKeySpecException
InvalidKeySpecException
public final PublicKey generatePublic(KeySpec keySpec) throws InvalidKeySpecException
InvalidKeySpecException
public final String getAlgorithm()
public final KeySpec getKeySpec(Key key, Class keySpec) throws InvalidKeySpecException
InvalidKeySpecException
public final Provider getProvider()
public final Key translateKey(Key key) throws InvalidKeyException
InvalidKeyException