public class TrustedResponders
extends java.lang.Object
If a basic OCSP response
is not
signed by the same issuer that has signed the target certificate the OCSP
client has to check if the response signer is authorized to sign the
response. In this case the certificate of the response signer has to be
issued by the issuer of the target certificate and has to contain the
ExtendedKeyUsage
extension
indicating the id-kp-OCSPSigning purpose.
This class provides a simple mechanism allowing to specify the set of CAs for
which each responder is trusted.
An OCSP Responder is identified by its ResponderID
. When calling method
addTrustedResponderEntry
supply the ID of the responder in mind and a CA
certificate which has authorized this responder for signing the response,
e.g.:
// targetCerts[0] contains the certificate for which revocation information shall be requested // targetCerts[0] is signed by targetCerts[1] X509Certificate[] targetCerts = ...; // responder cert is the cert used by the responder for signing a response X509Certificate responderCert = ...; // we want to trust this responder for signing responses for certs issued by targetCerts[1] TrustedResponders trustedResponders = new TrustedResponders(); ResponderID responderID = new ResponderID((Name)responderCert.getSubjectDN()); trustedResponders.addTrustedResponderEntry(responderID, targetCerts[1]);Note: this class provides a very simple trust repository utility maintained by a hashtable with one entry for each particular responderID. Each responder entry has its trusted CA certificates attached; so one CA certificate may appear repeatedly (e.g. for responder 1 and responder 2,...). An application may which to implement a more comprehensive strategy.
Constructor and Description |
---|
TrustedResponders()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addTrustedResponderEntry(ResponderID responderID,
X509Certificate caCert)
Trust the given reponderID for signing responses for certs issued by the
given CA.
|
void |
clearAllEntries()
Clear all entries.
|
boolean |
isTrustedResponder(ResponderID responderID,
X509Certificate responderCert,
X509Certificate caCert)
Checks if we can trust the given responder for signing responses for certs
issued by the given CA.
|
boolean |
removeTrustedResponder(ResponderID responderID)
Removes the given responder from the trust repository.
|
boolean |
removeTrustedResponderEntry(ResponderID responderID,
X509Certificate caCert)
Do not longer trust the given responder for signing responses for certs
issued by the given CA cert.
|
public TrustedResponders()
public boolean addTrustedResponderEntry(ResponderID responderID, X509Certificate caCert)
responderID
- the ID of the responder to trust for signing responses for certs
issued by the given CA certcaCert
- responses for certs issued by this CA cert can be signed by the
given responderpublic boolean removeTrustedResponder(ResponderID responderID)
responderID
- the ID of the responder to removepublic boolean removeTrustedResponderEntry(ResponderID responderID, X509Certificate caCert)
responderID
- the ID of the responder not to trust longer for signing responses
for certs issued by the given CA certcaCert
- responses for certs issued by this CA cert cannot be signed by the
given responderpublic boolean isTrustedResponder(ResponderID responderID, X509Certificate responderCert, X509Certificate caCert)
responderID
- the ID of the resonder in mindcaCert
- the CA certresponderCert
- the cert of the responderpublic void clearAllEntries()