public final class ResponderId
extends java.lang.Object
The RFC 6960 defines a ResponderID structure as:
ResponderID ::= CHOICE {
byName [1] Name,
byKey [2] KeyHash }
KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key
(excluding the tag and length fields)
Name is defined in RFC 5280.
ResponderId.Type| Modifier and Type | Class and Description |
|---|---|
static class |
ResponderId.Type
A
ResponderId enumeration describing the accepted forms for a
ResponderId. |
| Constructor and Description |
|---|
ResponderId(byte[] encodedData)
Constructs a
ResponderId object from its DER-encoding. |
ResponderId(java.security.PublicKey pubKey)
Constructs a
ResponderId object using a PublicKey. |
ResponderId(javax.security.auth.x500.X500Principal subjectName)
Constructs a
ResponderId object using an X500Principal. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this
ResponderId for equality. |
byte[] |
getEncoded()
Encode a
ResponderId in DER form |
KeyIdentifier |
getKeyIdentifier()
Obtain the underlying key identifier from a
ResponderId |
javax.security.auth.x500.X500Principal |
getResponderName()
Obtain the underlying
X500Principal from a ResponderId |
ResponderId.Type |
getType()
Return the type of
ResponderId |
int |
hashCode()
Returns the hash code value for this
ResponderId |
int |
length()
Get the length of the encoded
ResponderId (including the tag and
length of the explicit tagging from the outer ASN.1 CHOICE). |
java.lang.String |
toString()
Create a String representation of this
ResponderId |
public ResponderId(javax.security.auth.x500.X500Principal subjectName)
throws java.io.IOException
ResponderId object using an X500Principal.
When encoded in DER this object will use the BY_NAME option.subjectName - the subject name of the certificate used
to sign OCSP responses.java.io.IOException - if the internal DER-encoding of the
X500Principal fails.public ResponderId(java.security.PublicKey pubKey)
throws java.io.IOException
ResponderId object using a PublicKey.
When encoded in DER this object will use the byKey option, a
SHA-1 hash of the responder's public key.pubKey - the OCSP responder's public keyjava.io.IOException - if the internal DER-encoding of the
KeyIdentifier fails.public ResponderId(byte[] encodedData)
throws java.io.IOException
ResponderId object from its DER-encoding.encodedData - the DER-encoded bytesjava.io.IOException - if the encodedData is not properly DER encodedpublic byte[] getEncoded()
ResponderId in DER formResponderIdpublic ResponderId.Type getType()
ResponderIdResponderIdpublic int length()
ResponderId (including the tag and
length of the explicit tagging from the outer ASN.1 CHOICE).ResponderIdpublic javax.security.auth.x500.X500Principal getResponderName()
X500Principal from a ResponderIdX500Principal for this ResponderId if it
is a BY_NAME variant. If the ResponderId is a BY_KEY
variant, this routine will return null.public KeyIdentifier getKeyIdentifier()
ResponderIdKeyIdentifier for this ResponderId if it
is a BY_KEY variant. If the ResponderId is a BY_NAME
variant, this routine will return null.public boolean equals(java.lang.Object obj)
ResponderId for equality.
A ResponderId will only be considered equivalent if both the type and
data value are equal. Two ResponderIds initialized by name and
key ID, respectively, will not be equal even if the
ResponderId objects are created from the same source certificate.equals in class java.lang.Objectobj - the object to be compared againstResponderidpublic int hashCode()
ResponderIdhashCode in class java.lang.ObjectResponderIdpublic java.lang.String toString()
ResponderIdtoString in class java.lang.ObjectResponderId