public final class KeyAndCertificate
extends java.lang.Object
| Constructor and Description |
|---|
KeyAndCertificate(java.security.PrivateKey key,
java.security.cert.Certificate cert)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.security.cert.Certificate |
getCert()
Return the Certificate associated with this object
|
java.security.PrivateKey |
getKey()
Return the PrivateKey associated with this object
|
static KeyAndCertificate[] |
matchKeysToCertificates(java.util.List<java.security.PrivateKey> keys,
java.util.List<java.security.cert.Certificate> certificates)
Match a list of private keys to public keys in a list of certificates.
|
static java.security.KeyPair[] |
matchKeysToPublicKeys(java.util.List<java.security.PrivateKey> keys,
java.util.List<java.security.PublicKey> publicKeys)
Match a list of private keys to public keys.
|
static boolean |
matchKeyToCert(java.security.PrivateKey key,
java.security.cert.Certificate cert)
Convienance method for checking if a single key and certificate match.
|
static boolean |
matchKeyToPublicKey(java.security.PrivateKey privateKey,
java.security.PublicKey publicKey)
Convienance method for checking if a single key and public key match.
|
public KeyAndCertificate(java.security.PrivateKey key,
java.security.cert.Certificate cert)
key - The PrivateKeycert - The associated Public Certificatepublic java.security.cert.Certificate getCert()
public java.security.PrivateKey getKey()
public static boolean matchKeyToCert(java.security.PrivateKey key,
java.security.cert.Certificate cert)
key - The private key to be matched with the certificatecert - The Certificate to be matchedpublic static KeyAndCertificate[] matchKeysToCertificates(java.util.List<java.security.PrivateKey> keys, java.util.List<java.security.cert.Certificate> certificates)
keys - the list of private keys to find matching certificates for.certificates - the list of certificates to match to private keys. There can be
more certificates than private keys. Any certificates that do not match
a private key are removed from the list.public static boolean matchKeyToPublicKey(java.security.PrivateKey privateKey,
java.security.PublicKey publicKey)
key - The private key to be matched with the certificatepkey - the public key to be matched with the private keypublic static java.security.KeyPair[] matchKeysToPublicKeys(java.util.List<java.security.PrivateKey> keys,
java.util.List<java.security.PublicKey> publicKeys)
keys - the list of private keys to find matching public keyspublicKeys - the list of public keys to match to the private keys. There can be
more public keys than private keys. Any public keys that do not match
a private key are removed from the list.