public class KeychainIdentities extends java.util.AbstractCollection<KeychainIdentity> implements IdentityFilter
| Modifier and Type | Method and Description |
|---|---|
static KeychainIdentities |
findIdentities()
Searches the KeyChain for certificates that can be used to log in to a
User
object. |
static KeychainIdentities |
findIdentities(KeychainCertFilter filter)
Searches the Keychain for certificates that can be used to log in to a
User object. |
static KeychainIdentities |
findIdentities(KeychainCertFilter filter,
IdentityFilter idfilter)
Searches the Keychain for certificates that can be used to log in to
a
User object. |
static KeychainIdentity |
findIdentity(KeychainCertFilter filter)
This method returns the first KeychainIdentity found after searching for identities
with the specific filter.
|
KeychainIdentity |
findMatchingIdentity(ContainerName containerName)
Finds the identity to which the given key container name belongs.
|
KeychainIdentity |
findMatchingIdentity(KeychainCertificateAndKeyInfo kcaki,
IdentityFilter filter)
Finds the identity to which the given KeychainCertificateAndKeyInfo matches by
calling the
KeychainIdentityFilter#matchIdentity(KeychainIdentity, KeychainCertificateAndKeyInfo)
method. |
java.util.Iterator<KeychainIdentity> |
iterator()
Returns an
Iterator that can be used to iterate through all
identities stored in this set. |
boolean |
matchIdentity(Identity identity,
CertificateAndKeyInfo caki)
Check if the passed in KeychainCerticateAndKeyInfo belongs to the specified KeychainIdentity.
|
int |
size()
Returns the number of identities in this collection.
|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic KeychainIdentity findMatchingIdentity(ContainerName containerName)
containerName - The name of the key container for which to find a matching identitynull if no matching
identity is found.public KeychainIdentity findMatchingIdentity(KeychainCertificateAndKeyInfo kcaki, IdentityFilter filter)
KeychainIdentityFilter#matchIdentity(KeychainIdentity, KeychainCertificateAndKeyInfo)
method.kcaki - The KeychainCertificateAndKeyInfo which will be used to find certificates and key that belong
to this identity.filter - The KeychainIdentityFilter used to find the certificates and keys that belong to this
identity.null if no matching
identity is found.public static KeychainIdentities findIdentities() throws KeychainException
User
object. To be acceptable, a certificate must:
KeychainIdentity objects that may be used
to construct a KeychainCredentialReader to log in to a
UserKeychainException - if any non-recoverable error occurs searching for certificates, such
as not being able to read keys from the Keychainpublic static KeychainIdentity findIdentity(KeychainCertFilter filter) throws KeychainException
CertIdentityCertFilter.filter - The KeychainCertFilter used to filter out acceptable certificates used
to find identitiesKeychainException - if an error occursKeychainCertFilterpublic static KeychainIdentities findIdentities(KeychainCertFilter filter) throws KeychainException
User object.
The KeychainCertFilter is used to filter out certificates that should not
be considered for use when searching for identities
filter - The KeychainCertFilter used to filter out certificates which
should be considered acceptable.KeychainIdentity objects that may be used
to construct a KeychainCredentialReader to log in to a
UserKeychainException - if any non-recoverable error occurs searching for certificates,KeychainIdentityCertFilter,
UnverifiedCertFilter,
KeychainSearchFilterpublic static KeychainIdentities findIdentities(KeychainCertFilter filter, IdentityFilter idfilter) throws KeychainException
User object.
The KeychainCertFilter is used to filter out certificates that should not
be considered for use when searching for identities
The KeychainIdentityFilter is used to identify certificates which should
belong to the same identity. Null may be specified to indicate the default
matchIdentity(Identity, CertificateAndKeyInfo) filter will be used.
filter - The KeychainCertFilter used to filter out certificates which should not be
considered acceptable.idfilter - The KeychainIdentityFilter used to match the certificates and keys that belong
to the same identity.KeychainIdentity objects that may be used
to construct a KeychainCredentialReader to log in to a
UserKeychainException - if any non-recoverable error occurs searching for certificates,KeychainIdentityCertFilter,
UnverifiedCertFilter,
KeychainSearchFilterpublic boolean matchIdentity(Identity identity, CertificateAndKeyInfo caki)
In an Entrust Identity, there can be multiple certificates and keys. For example, encryption, verification and
non-repudiation. When these certificates are stored in the Keychain using Entrust, the ContainerName
is used to find other certificates that may be associated with that identity. However, if the Entrust
certificates were added into Keychain using a third-party mechanism, such as a P11 driver, or an export from
P12, then the Entrust container format will not be used. Therefore, this identity will be considered an
unknown identity and the toolkit will use the SubjectDN and IssuerDN of the certificates in Keychain to find
the certificates that belong to the same identity.
Note: Because the Entrust container format was not used when writing the certificates into Keychain, this identity will not be able to be managed by the toolkit. Attempting to manage such an identity may result in undefined behaviour, and is not supported by the toolkit.
matchIdentity in interface IdentityFilteridentity - The KeychainIdentityccaki - The KeychainCertificateAndKeyInfopublic java.util.Iterator<KeychainIdentity> iterator()
Iterator that can be used to iterate through all
identities stored in this set. The object returned by calling the
next() method of the iterator should be cast to a
KeychainIdentity.iterator in interface java.lang.Iterable<KeychainIdentity>iterator in interface java.util.Collection<KeychainIdentity>iterator in class java.util.AbstractCollection<KeychainIdentity>Iterator that can be used to iterate through all
identities stored in this set.public int size()
size in interface java.util.Collection<KeychainIdentity>size in class java.util.AbstractCollection<KeychainIdentity>