|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--iaik.security.ssl.ChainVerifier
A ChainVerifier object keeps track of trusted certificates and verifies certificate chains. It is used in peer authentication, both on the client and on the server side. The class is application extensible, i.e. the iSaSiLk distribution contains a fairly basic X.509v1 style implementation (for example, it does not handle X.509v3 extensions and has no kind of revocation checking) that can be replaced by a more advanced one if desired.
This documentation describes the default implementation, which all other implementations have to be compatible with. Note that during the handshake the library only calls two methods:
verifyChain() to verify certificate chains.
getTrustedPrincipalsArray() on the
server if client authentication is enabled.
For more information about authentication see the separate document on Certificates and Authentication.
| Field Summary | |
protected boolean |
nullTrusted
Flag indicating if null (no certificate) is trusted. |
protected java.util.Hashtable |
trustedCerts
Hashtable containing trusted certificates mapping Principal(subject) -> X509Certificate(trusted certificate). |
| Constructor Summary | |
|
ChainVerifier()
Create a new ChainVerifier. |
protected |
ChainVerifier(int k)
Constructor for use by subclasses. |
| Method Summary | |
void |
addTrustedCertificate(X509Certificate cert)
Add a trusted certificate. |
protected X509Certificate |
getIssuerCertificate(X509Certificate cert)
Get the issuer certificate of the given certificate (if available in the pool of trusted certificates). |
java.util.Enumeration |
getTrustedPrincipals()
Enumerate the explicitly trusted Principals. |
Principal[] |
getTrustedPrincipalsArray()
Return the explicitly trusted Principals. |
protected boolean |
isTrustedCertificate(X509Certificate cert)
Check is the certificate is explicitly trusted. |
void |
removeTrustedCertificate(X509Certificate cert)
Remove a trusted certificate. |
int |
size()
Return the number of explicitly trusted certificates. |
protected boolean |
verifyCertificate(X509Certificate cert,
X509Certificate issuerCert)
Verify a certificate given its issuer certificates. |
boolean |
verifyChain(X509Certificate[] certs,
SSLTransport transport)
Verify a certificate chain. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.util.Hashtable trustedCerts
protected boolean nullTrusted
| Constructor Detail |
protected ChainVerifier(int k)
public ChainVerifier()
| Method Detail |
public void addTrustedCertificate(X509Certificate cert)
public void removeTrustedCertificate(X509Certificate cert)
public int size()
public java.util.Enumeration getTrustedPrincipals()
public Principal[] getTrustedPrincipalsArray()
protected boolean isTrustedCertificate(X509Certificate cert)
In the default implementation this method is only called by verifyChain() and verifyCertificate().
protected boolean verifyCertificate(X509Certificate cert,
X509Certificate issuerCert)
throws java.lang.Exception
The default implementation does the following in order:
In the default implementation this method is only called by verifyChain().
protected X509Certificate getIssuerCertificate(X509Certificate cert)
In the default implementation this method is called only by verifyChain().
public boolean verifyChain(X509Certificate[] certs,
SSLTransport transport)
Note that the default implementation of this method can only be used if the methods isTrustedCertificate(), verifyCertificate(), and getIssuerCertificate() behave as described above.
The default implementation does the following in order:
verifyCert().
If any call returns true it returns true, if any throws an exception it
returns false.
size() returns 0, i.e. no certificates are
trusted at all.
That means invalid certificate chains (signatures that do not verify, expired certificates) are never accepted. If trusted certificates are set only valid chains containing a trusted certificate are accepted, otherwise all valid chains are accepted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||