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 public keys have two members, one for the public 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.
| Modifier and Type | Field and Description |
|---|---|
| protected AlgorithmId | |
| private transient BitArray | |
| protected byte[] | |
| private static final long | serialVersionUID
use serialVersionUID from JDK 1.1.
|
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static PublicKey | |
| public void | |
| public void | |
| public final void | encode(DerOutputStream out)
Implements sun. Encode SubjectPublicKeyInfo sequence on the DER output stream. |
| public byte[] | |
| pack-priv static void | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | getAlgorithm()
Implements java. Returns the algorithm to be used with this key. |
| public AlgorithmId | |
| public byte[] | getEncoded()
Implements java. Returns the DER-encoded form of the key as a byte array. |
| private byte[] | |
| public String | |
| public BitArray | |
| public byte[] | |
| public int | |
| public static PublicKey | |
| protected void | |
| private void | |
| protected void | |
| public String | |
| private void |
| algid | back to summary |
|---|---|
| protected AlgorithmId algid | |
| bitStringKey | back to summary |
|---|---|
| private transient BitArray bitStringKey | |
| encodedKey | back to summary |
|---|---|
| protected byte[] encodedKey | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. use serialVersionUID from JDK 1.1. for interoperability | |
| X509Key | back to summary |
|---|---|
| public X509Key() Default constructor. The key constructed must have its key
and algorithm initialized before it may be used, for example
by using | |
| X509Key | back to summary |
|---|---|
public X509Key(AlgorithmId algid, BitArray key)
| |
| buildX509Key | back to summary |
|---|---|
| pack-priv static PublicKey buildX509Key(AlgorithmId algid, BitArray key) throws IOException, InvalidKeyException | |
| decode | back to summary |
|---|---|
| public void decode(DerValue val) throws InvalidKeyException Initialize an X509Key object from a DerValue, obeying the X.509
Subclasses should not normally redefine this method; they should
instead provide a The exception to this rule is that since private keys need not
be encoded using the X.509
| |
| decode | back to summary |
|---|---|
| public void decode(byte[] encodedKey) throws InvalidKeyException | |
| encode | back to summary |
|---|---|
| public final void encode(DerOutputStream out) Implements sun. Encode SubjectPublicKeyInfo sequence on the DER output stream.
| |
| encode | back to summary |
|---|---|
| public byte[] encode() Returns the DER-encoded form of the key as a byte array. | |
| encode | back to summary |
|---|---|
| pack-priv static void encode(DerOutputStream out, AlgorithmId algid, BitArray key) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getAlgorithm | back to summary |
|---|---|
| public String getAlgorithm() Implements java. Returns the algorithm to be used with this key. | |
| getAlgorithmId | back to summary |
|---|---|
| public AlgorithmId getAlgorithmId() Returns the algorithm ID to be used with this key. | |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Implements java. Returns the DER-encoded form of the key as a byte array. | |
| getEncodedInternal | back to summary |
|---|---|
| private byte[] getEncodedInternal() | |
| getFormat | back to summary |
|---|---|
| public String getFormat() Implements java. Returns the format for this key: "X.509" | |
| getKey | back to summary |
|---|---|
| public BitArray getKey() Gets the key. The key may or may not be byte aligned.
| |
| getKeyAsBytes | back to summary |
|---|---|
| public byte[] getKeyAsBytes() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Calculates a hash code value for the object. Objects which are equal will also have the same hashcode.
| |
| parse | back to summary |
|---|---|
| public static PublicKey parse(DerValue in) throws IOException Construct X.509 subject public 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. This mechanism guarantees that keys (and algorithms) may be freely manipulated and transferred, without risk of losing information. Also, when a key (or algorithm) needs some special handling, that specific need can be accommodated.
| |
| parseKeyBits | back to summary |
|---|---|
| protected void parseKeyBits() throws InvalidKeyException Parse the key bits. This may be redefined by subclasses to take
advantage of structure within the key. For example, RSA public
keys encapsulate two unsigned integers (modulus and exponent) as
DER values within the This function is called when creating X.509 SubjectPublicKeyInfo
values using the X509Key member functions, such as
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream stream) throws IOException Serialization read ... X.509 keys serialize as themselves, and they're parsed when they get read back.
| |
| setKey | back to summary |
|---|---|
| protected void setKey(BitArray key) Sets the key in the BitArray form. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream stream) throws IOException Serialization write ... X.509 keys serialize as themselves, and they're parsed when they get read back.
| |