KeyFactory implementations that can be
configured with a named parameter set. See NamedKeyPairGenerator
for more details.
This factory supports reading and writing to RAW formats:
translateKey if key.getFormat is "RAW".
EncodedKeySpec if getKeySpec(key, EncodedKeySpec.class)
is called. The format of the output is "RAW" and the algorithm is
intentionally left unspecified.
When reading from a RAW format, it needs enough info to derive the parameter set name.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| protected | NamedKeyFactory(String
the family name fname, String... the standard parameter set names, at least one is needed. pnames)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| protected PrivateKey | engineGeneratePrivate(KeySpec keySpec)
Implements abstract java. Generates a private key object from the provided key specification (key material). |
| protected PublicKey | engineGeneratePublic(KeySpec keySpec)
Implements abstract java. Generates a public key object from the provided key specification (key material). |
| protected <T extends KeySpec> T | engineGetKeySpec(Key key, Class<T> keySpec)
Implements abstract java. Returns a specification (key material) of the given key object. |
| protected Key | engineTranslateKey(Key key)
Implements abstract java. Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory. |
| private PrivateKey | |
| private PrivateKey | |
| private PublicKey | |
| protected abstract byte[] | Returns: the expanded key, not nullthe parameter set name pname, byte[] the encoding, could be any format input)User-defined function to generate the expanded format of
a |
| protected Key |
| fname | back to summary |
|---|---|
| private final String fname | |
| pnames | back to summary |
|---|---|
| private final String[] pnames | |
| NamedKeyFactory | back to summary |
|---|---|
| protected NamedKeyFactory(String fname, String... pnames) Creates a new | |
| checkName | back to summary |
|---|---|
| private String checkName(String pname) throws InvalidKeyException | |
| engineGeneratePrivate | back to summary |
|---|---|
| protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException Implements abstract java. Doc from java. Generates a private key object from the provided key specification (key material).
| |
| engineGeneratePublic | back to summary |
|---|---|
| protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException Implements abstract java. Doc from java. Generates a public key object from the provided key specification (key material).
| |
| engineGetKeySpec | back to summary |
|---|---|
| protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException Implements abstract java. Doc from java. Returns a specification (key material) of the given key
object.
| |
| engineTranslateKey | back to summary |
|---|---|
| protected Key engineTranslateKey(Key key) throws InvalidKeyException Implements abstract java. Doc from java. Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
| |
| fromPKCS8 | back to summary |
|---|---|
| private PrivateKey fromPKCS8(byte[] bytes) throws InvalidKeyException | |
| fromRaw | back to summary |
|---|---|
| private PrivateKey fromRaw(String pname, byte[] raw) throws InvalidKeyException | |
| fromX509 | back to summary |
|---|---|
| private PublicKey fromX509(byte[] bytes) throws InvalidKeyException | |
| implExpand | back to summary |
|---|---|
| protected abstract byte[] implExpand(String pname, byte[] input) throws InvalidKeyException User-defined function to generate the expanded format of
a This method is called when the key factory is constructing a private key. The ownership of the result is fully granted to the caller.
| |
| toNamedKey | back to summary |
|---|---|
| protected Key toNamedKey(Key key) throws InvalidKeyException | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getFormat()
Implements abstract java. Returns the name of the encoding format associated with this key specification. |
| RawEncodedKeySpec | back to summary |
|---|---|
| public RawEncodedKeySpec(byte[] encodedKey) | |
| getFormat | back to summary |
|---|---|
| public String getFormat() Implements abstract java. Doc from java. Returns the name of the encoding format associated with this key specification. If the opaque representation of a key
(see
| |