public class KeyFactory
extends java.lang.Object
Key
).Key
,
PublicKey
,
KeySpec
,
X509EncodedKeySpec
Modifier and Type | Method and Description |
---|---|
PublicKey |
generatePublic(KeySpec keySpec)
Generates a public key object from the provided key specification
(key material).
|
static KeyFactory |
getInstance(java.lang.String algorithm)
Generates a KeyFactory object that implements the specified
algorithm.
|
public static KeyFactory getInstance(java.lang.String algorithm) throws NoSuchAlgorithmException
algorithm
- the name of the requested key algorithm.
See Appendix A in the
Java Cryptography Architecture API Specification & Reference
for information about standard algorithm names.KeyFactory
object for the specified algorithm.NoSuchAlgorithmException
- if the requested algorithm is
not availablepublic final PublicKey generatePublic(KeySpec keySpec) throws InvalidKeySpecException
keySpec
- the specification (key material) of the public key.InvalidKeySpecException
- if the given key specification
is inappropriate for this key factory to produce a public key.Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.