com.sun.identity.saml.xmlsig
Class JKSKeyProvider
java.lang.Object
|
+--com.sun.identity.saml.xmlsig.JKSKeyProvider
- All Implemented Interfaces:
- KeyProvider
- public synchronized class JKSKeyProvider
- extends java.lang.Object
- implements KeyProvider
Method Summary |
java.security.cert.Certificate |
getCertificate(java.security.PublicKey)
Returns certificate corresponding to the specified
PublicKey . |
java.security.cert.Certificate |
getCertificate(java.lang.String)
|
java.lang.String |
getCertificateAlias(java.security.cert.Certificate)
Get the alias name of the first keystore entry whose certificate matches
the given certificate. |
java.security.KeyStore |
getKeyStore()
|
java.security.PrivateKey |
getPrivateKey(java.lang.String)
Returns java.security.PrivateKey for the specified
certAlias . |
java.lang.String |
getPrivateKeyPass()
|
java.security.PublicKey |
getPublicKey(java.lang.String)
Returns java.security.PublicKey for the specified
keyAlias |
java.security.cert.X509Certificate |
getX509Certificate(java.lang.String)
Return java.security.cert.X509Certificate for the specified
certAlias . |
void |
setCertificateEntry(java.lang.String,
java.security.cert.Certificate)
|
void |
setKey(java.lang.String,
java.lang.String)
Set the key to access key store database. |
void |
store()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JKSKeyProvider
public JKSKeyProvider()
setKey
public void setKey(java.lang.String,
java.lang.String)
- Description copied from interface:
KeyProvider
- Set the key to access key store database. This method will only need to
be called once if the key could not be obtained by other means.
- Specified by:
setKey
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
storepass
- password for the key storekeypass
- password for the certificate
getX509Certificate
public java.security.cert.X509Certificate getX509Certificate(java.lang.String)
- Description copied from interface:
KeyProvider
- Return
java.security.cert.X509Certificate
for the specified
certAlias
.
- Specified by:
getX509Certificate
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
certAlias
- Certificate alias name- Returns:
X509Certificate
which matches the
certAlias
, return null if the certificate could not
be found.
getPublicKey
public java.security.PublicKey getPublicKey(java.lang.String)
- Description copied from interface:
KeyProvider
- Returns
java.security.PublicKey
for the specified
keyAlias
- Specified by:
getPublicKey
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
keyAlias
- Key alias name- Returns:
PublicKey
which matches the keyAlias
,
return null if the PublicKey
could not be found.
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.String)
- Description copied from interface:
KeyProvider
- Returns
java.security.PrivateKey
for the specified
certAlias
.
- Specified by:
getPrivateKey
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
certAlias
- Certificate alias name- Returns:
PrivateKey
which matches the certAlias
,
return null if the private key could not be found.
getCertificateAlias
public java.lang.String getCertificateAlias(java.security.cert.Certificate)
- Description copied from interface:
KeyProvider
- Get the alias name of the first keystore entry whose certificate matches
the given certificate.
- Specified by:
getCertificateAlias
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
cert
- Certificate- Returns:
- the (alias) name of the first entry with matching certificate,
or null if no such entry exists in this keystore. If the keystore
has not been loaded properly, return null as well.
getPrivateKeyPass
public java.lang.String getPrivateKeyPass()
getKeyStore
public java.security.KeyStore getKeyStore()
setCertificateEntry
public void setCertificateEntry(java.lang.String,
java.security.cert.Certificate)
throws SAMLException
getCertificate
public java.security.cert.Certificate getCertificate(java.lang.String)
store
public void store()
throws SAMLException
getCertificate
public java.security.cert.Certificate getCertificate(java.security.PublicKey)
- Description copied from interface:
KeyProvider
- Returns certificate corresponding to the specified
PublicKey
.
- Specified by:
getCertificate
in interface KeyProvider
- Following copied from interface:
com.sun.identity.saml.xmlsig.KeyProvider
- Parameters:
publicKey
- Certificate public key- Returns:
- Certificate which matches the
PublicKey
, return
null if the Certificate could not be found.
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.