Name
Class java.security.KeyFactory
Synopsis
A key factory is an engine class that is capable of translating
between public or private key objects and their external format (and
vice versa). Hence, key factories may be used to import or export
keys, as well as to translate keys of one class (e.g.,
com.acme.DSAPublicKey
) to another class (e.g.,
com.xyz.DSAPublicKeyImpl
) as long as those
classes share the same base class. Key factories operate in terms of
key specifications; these specifications are the various external
formats in which a key may be transmitted. Keys are imported via the
generatePublic()
and
generatePrivate()
methods, they are exported via
the getKeySpec()
method, and they are translated
via the translateKey()
method.
Class Definition
public class java.security.KeyFactory extends java.lang.Object { // Constructors protected KeyFactory(KeyFactorySpi, Provider, String); // Class Methods public static final KeyFactory getInstance(String); public static final KeyFactory getInstance(String, String); // Instance Methods public final PrivateKey generatePrivate(KeySpec); public final PublicKey generatePublic(KeySpec); public final String getAlgorithm(); public final KeySpec getKeySpec(Key, Class); public final Provider getProvider(); public final Key translateKey(Key); }
See also:
KeyFactorySpi
, KeySpec
Get Java Security now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.