OneAsymmetricKey.
The OneAsymmetricKey syntax is defined in the PKCS#8 standard
as follows:
OneAsymmetricKey ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] Attributes OPTIONAL,
...,
[[2: publicKey [1] PublicKey OPTIONAL ]],
...
}
PrivateKeyInfo ::= OneAsymmetricKey
Version ::= INTEGER { v1(0), v2(1) }
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
PublicKey ::= BIT STRING
Attributes ::= SET OF Attribute
java.security.Key , java.security.KeyFactory , KeySpec, EncodedKeySpec, X509EncodedKeySpec
| Access | Constructor and Description |
|---|---|
| public | PKCS8EncodedKeySpec(byte[]
the key, which is assumed to be
encoded according to the PKCS #8 standard. The contents of
the array are copied to protect against subsequent modification. encodedKey)Creates a new |
| public | PKCS8EncodedKeySpec(byte[]
the key, which is assumed to be
encoded according to the PKCS #8 standard. The contents of
the array are copied to protect against subsequent modification. encodedKey, String the algorithm name of the encoded private key.
See the AsymmetricKey Algorithms section in the
Java Security Standard Algorithm Names Specification
for information about standard asymmetric key algorithm names. algorithm)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | Returns: the PKCS #8 encoding of the key. Returns a new array each time this method is called.Overrides java. Returns the key bytes, encoded according to the PKCS #8 standard. |
| public final String | Returns: the string"PKCS#8".Implements abstract java. Returns the name of the encoding format associated with this key specification. |
| PKCS8EncodedKeySpec | back to summary |
|---|---|
| public PKCS8EncodedKeySpec(byte[] encodedKey) Creates a new
| |
| PKCS8EncodedKeySpec | back to summary |
|---|---|
| public PKCS8EncodedKeySpec(byte[] encodedKey, String algorithm) Creates a new
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Overrides java. Returns the key bytes, encoded according to the PKCS #8 standard.
| |
| getFormat | back to summary |
|---|---|
| public final String getFormat() Implements abstract java. Returns the name of the encoding format associated with this key specification.
| |