public final class CapiCredentialReader extends CredentialReader
CredentialReader for reading a Digital Identity from
CAPI. This class can be created in one of two ways, either by providing
an array of handles to CAPI certificates, or by providing a
CapiIdentity object. The method using the
CapiIdentity object is the preferred way, the array of
certificate handles is for specialized uses for when the set of certificates
chosen by the CapiIdentity is not appropriate.
No CredentialWriter object can be used in conjunction with a
CapiCredentialReader; a Digital Identity read from CAPI is
strictly read-only.
When calling User.login() with a CapiCredentialReader,
supply null as the password. With CAPI, the key protection mechanism
may not be password based, and is up to the CAPI CSP to enforce.
CapiIdentity,
CapiIdentities| Constructor and Description |
|---|
CapiCredentialReader(CapiIdentity identity)
Create a
CapiCredentialReader that reads certificates
and keys for the given CapiIdentity. |
CapiCredentialReader(CertContext[] contexts)
Create a
CapiCredentialReader that reads certificates
and keys from the given array CertContext objects. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getType()
Returns the type (name) of this
CredentialReader. |
checkPwdpublic CapiCredentialReader(CapiIdentity identity)
CapiCredentialReader that reads certificates
and keys for the given CapiIdentity. The identity should
be created by calling CapiIdentities.findIdentities(),
then selecting the appropriate identity from the returned list.identity - The identity to read keys and certificates for.public CapiCredentialReader(CertContext[] contexts)
CapiCredentialReader that reads certificates
and keys from the given array CertContext objects. This
is for advanced usage, when the set of keys and certificates selected
by a CapiIdentity is not appropriate. While it would be
possible to pick certificates from different identities, and even
different CAs, the behaviour under such circumstances is undefined.contexts - The certificates from which to obtain the private key/certificate
pairs.public java.lang.String getType()
CredentialReader.getType in class CredentialReaderCredentialReader