X509Key

Holds an X.509 key, for example a key found in an X.509 certificate. Includes a description of the algorithm to be used with the key; these keys normally are used as "SubjectPublicKeyInfo".

<P>While this class can represent any kind of X.509 key, it may be desirable to provide subclasses which understand how to parse keying data. For example, RSA keys have two members, one for the modulus and one for the prime exponent. If such a class is provided, it is used when parsing X.509 keys. If one is not provided, the key still parses correctly.

@author David Brownell

Members

Functions

encode
void encode(DerOutputStream stream)

Encode SubjectPublicKeyInfo sequence on the DER output stream.

encode
byte[] encode()

Returns the DER-encoded form of the key as a byte array.

getAlgorithm
string getAlgorithm()

Returns the algorithm to be used with this key.

getAlgorithmId
AlgorithmId getAlgorithmId()

Returns the algorithm ID to be used with this key.

getEncoded
byte[] getEncoded()

Returns the DER-encoded form of the key as a byte array.

getEncodedInternal
byte[] getEncodedInternal()
Undocumented in source. Be warned that the author may not have intended to support it.
getFormat
string getFormat()

Returns the format for this key: "X.509"

getKey
BitArray getKey()

Gets the key. The key may or may not be byte aligned. @return a BitArray containing the key.

Static functions

encode
void encode(DerOutputStream stream, AlgorithmId algid, BitArray key)
Undocumented in source. Be warned that the author may not have intended to support it.
parse
PublicKey parse(DerValue value)

Construct X.509 subject key from a DER value. If the runtime environment is configured with a specific class for this kind of key, a subclass is returned. Otherwise, a generic X509Key object is returned.

Variables

algid
AlgorithmId algid;

use serialVersionUID from JDK 1.1. for interoperability

encodedKey
byte[] encodedKey;
Undocumented in source.

Meta