Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security.cert

Class Certificate

java.lang.Object
|
+--java.security.cert.Certificate


public abstract class Certificate

extends Object

The Certificate class is an abstract class used to manage identity certificates. An identity certificate is a combination of a principal and a public key which is certified by another principal. This is the puprose of Certificate Authorities (CA). This class is used to manage different types of certificates but have important common puposes. Different types of certificates like X.509 and OpenPGP share general certificate functions (like encoding and verifying) and information like public keys. X.509, OpenPGP, and SDSI can be implemented by subclassing this class even though they differ in storage methods and information stored.

Since:Author:

Constructor Summary

Certificate(java.lang.String type)

Constructs a new certificate of the specified type.

Method Summary

booleanequals(java.lang.Object other)

Compares this Certificate to other.
byte[]getEncoded()

Gets the DER ASN.1 encoded format for this Certificate.
java.security.PublicKeygetPublicKey()

Returns the public key stored in the Certificate.
java.lang.StringgetType()

Returns the Certificate type.
inthashCode()

Returns a hash code for this Certificate in its encoded form.
java.lang.StringtoString()

Returns a string representing the Certificate.
voidverify(java.security.PublicKey key)

Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key.
voidverify(java.security.PublicKey key, java.lang.String sigProvider)

Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key and uses the signature engine provided by the provider.

Constructor Details

Certificate

protected Certificate(java.lang.String type)

Constructs a new certificate of the specified type. An example is "X.509".

Parameters:


Method Details

equals

public boolean equals(java.lang.Object other)

Compares this Certificate to other. It checks if the object if instanceOf Certificate and then checks if the encoded form matches.

Parameters:

Returns:


getEncoded

public byte[] getEncoded()

Gets the DER ASN.1 encoded format for this Certificate. It assumes each certificate has only one encoding format. Ex: X.509 is encoded as ASN.1 DER

Returns:

Throws:


getPublicKey

public PublicKey getPublicKey()

Returns the public key stored in the Certificate.

Returns:


getType

public final String getType()

Returns the Certificate type.

Returns:


hashCode

public int hashCode()

Returns a hash code for this Certificate in its encoded form.

Returns:


toString

public String toString()

Returns a string representing the Certificate.

Returns:


verify

public void verify(java.security.PublicKey key)

Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key.

Parameters:

Throws:


verify

public void verify(java.security.PublicKey key, java.lang.String sigProvider)

Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key and uses the signature engine provided by the provider.

Parameters:

Throws: