public class Trustmanager extends java.lang.Object implements X509TrustManagerInterface
Trustmanager class implements an
X509TrustManagerInterface used by the Toolkit when verifying
certificates in XML signatures and encrypting XML elements.| Constructor and Description |
|---|
Trustmanager()
Instantiates a
Trustmanager object. |
Trustmanager(KeyAndCertificateSource source)
Initializes a
Trustmanager from a KeyAndCertificateSource. |
Trustmanager(User user)
Deprecated.
use the
Trustmanager(KeyAndCertificateSource source) constructor instead.
You could construct that KeyAndCertificateSource from a User. |
| Modifier and Type | Method and Description |
|---|---|
java.security.cert.X509Certificate |
getCertificate(byte[] subjectKeyIdentifierValue)
Searches the memory cache for the verification certificate that is unambigously
identified by
SubjectKeyIdentifier. |
java.security.cert.X509Certificate |
getCertificate(java.security.Principal issuer,
java.math.BigInteger serialNumber)
Searches the memory cache for the verification certificate that
is unambigously identified by the issuer and serial number.
|
java.security.cert.X509Certificate[] |
getCertificates(java.security.Principal principal)
Searches the trust manager for all verification certificates that have
a particular
Principal as the certificate subject. |
boolean |
isTrusted(java.security.cert.X509Certificate trustCandidate)
Determines whether a specified certificate is to be trusted by
the trust management system.
|
void |
load(User user)
Deprecated.
use the
Trustmanager(KeyAndCertificateSource source) constructor instead. |
void |
putCertificates(java.security.cert.X509Certificate[] certs)
Adds certificates into the trust manager.
|
void |
putCRL(java.security.cert.X509CRL cRL)
Puts a CRL in the trust management system.
|
public Trustmanager()
Trustmanager object.public Trustmanager(User user) throws UserNotLoggedInException
Trustmanager(KeyAndCertificateSource source) constructor instead.
You could construct that KeyAndCertificateSource from a User.Trustmanager.
Through the User, the Toolkit has secure access to a root of trust.
It can then validate the verification certificates it receives in XML signatures
and the encryption certificates it needs to encrypt XML elements.
user - is a logged in User objectUserNotLoggedInException - user must be logged inpublic Trustmanager(KeyAndCertificateSource source)
Trustmanager from a KeyAndCertificateSource.
Through the KeyAndCertificateSource, the Toolkit has secure access
to a CertVerifier, with which it validates the verification certificates
it receives in XML signatures and the encryption certificates it uses to encrypt XML
documents.
source - is a KeyAndCertificateSource objectCertVerifierpublic void load(User user) throws UserNotLoggedInException
Trustmanager(KeyAndCertificateSource source) constructor instead.Trustmanager.user - is a User object that must already be logged inUserNotLoggedInException - user must already logged inpublic void putCertificates(java.security.cert.X509Certificate[] certs)
putCertificates in interface X509TrustManagerInterfacecerts - the certificates to be addedpublic java.security.cert.X509Certificate[] getCertificates(java.security.Principal principal)
throws X509TrustManagerException
Principal as the certificate subject. The
verification certificates must have been put into the trust manager
by a prior invocation of putCertificates(X509Certificate[]).
The method does not validate the returned certificates -- you must invoke
isTrusted(X509Certificate).
getCertificates in interface X509TrustManagerInterfaceprincipal - identifies the subject DN of the certificateX509TrustManagerException - if getting the requested certificates fails for any reason.putCertificates(java.security.cert.X509Certificate[] certs)public void putCRL(java.security.cert.X509CRL cRL)
putCRL in interface X509TrustManagerInterfacecRL - the certificate revocation list can be nullpublic boolean isTrusted(java.security.cert.X509Certificate trustCandidate)
throws X509TrustManagerException
isTrusted in interface X509TrustManagerInterfacetrustCandidate - the certificate to be tested must not be nulltrue if the certificate is trustedX509TrustManagerException - if obtaining the trust decision fails for any reasonpublic java.security.cert.X509Certificate getCertificate(java.security.Principal issuer,
java.math.BigInteger serialNumber)
throws X509TrustManagerException
getCertificate in interface X509TrustManagerInterfaceissuer - the issuer of the certificate must not be nullserialNumber - the serial number of the certificate must not be nullnullX509TrustManagerException - if getting the requested certificate fails for any reasonpublic java.security.cert.X509Certificate getCertificate(byte[] subjectKeyIdentifierValue)
throws X509TrustManagerException
SubjectKeyIdentifier.getCertificate in interface X509TrustManagerInterfacesubjectKeyIdentifierValue - the plain (non-DER-encoded) value of the X509.V3
certificate extension named SubjectKeyIdentifer
(OID 2.5.29.14). Must not be null.nullX509TrustManagerException - certificate cannot be verified