|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.trustbase.security.store.TokenKeyStore
TokenKeyStore is similar to the JCA notion of a KeyStore, but implements function more appropriate to implementation by hardware tokens
TokenKeyStore supports two types of entries: KeyEntrys and TrustedCertificateEntrys Either type of entry is associated with at least one aliases. An alias which is the RFC 2253 encoding of the subject name in the certificate is guaranteed to be associated with the entry. Support for additional aliases is implementation dependent
Field Summary | |
static java.lang.String |
PROVIDER_PROPERTY
the Provider property which specifies implementations of TokenKeyStores |
Constructor Summary | |
TokenKeyStore()
|
Method Summary | |
abstract TrustedCertificateEntry |
addTrustedCertificateEntry(java.lang.String alias,
java.security.cert.X509Certificate cert)
import a trusted certificate. |
abstract java.util.Set |
aliases()
get a list of all the aliases in use in this TokenKeyStore |
abstract java.security.cert.X509Certificate[] |
completeCertificateChain(java.security.cert.X509Certificate[] partialChain)
complete a certificate chain, given a partial chain |
abstract void |
deleteEntry(TokenKeyStoreEntry entry)
delete an entry from the TokenKeyStore |
abstract void |
doCommand(java.lang.String commandVerb,
java.lang.String[] arguments)
perform an implementation specific command |
abstract byte[] |
exportPKCS12KeyEntry(java.lang.String alias,
PasswordCallback callback)
export a KeyEntry to a PKCS#12 archive |
abstract KeyEntry |
generateKeyPair(java.lang.String alias,
java.lang.String subjectName,
java.lang.String algorithm,
int keysize)
generate a KeyPair on the token, using default parameters for the specified algorithm. |
abstract java.util.Set |
getAllEntries()
get all TokenKeySTore entries |
abstract java.util.Set |
getAllKeyEntries()
get all KeyEntries from the KeyStore |
abstract java.util.Set |
getAllTrustedCertificateEntries()
list all TrustedCertificateEntries on the token |
abstract TokenKeyStoreEntry |
getEntry(java.lang.String alias)
get the entry with a given alias |
abstract TokenKeyStoreEntry |
getEntry(java.lang.String issuer,
java.math.BigInteger serialNo)
get an entry whose certificate has the given issuer and serial number |
abstract TokenKeyStoreEntry |
getEntry(java.security.cert.X509Certificate cert)
get an entry whose certificate matches the provided cert |
static TokenKeyStore |
getInstance(java.lang.String type,
java.lang.String location,
PasswordCallback callback)
get a TokenKeyStore |
abstract KeyEntry |
getKeyEntry(java.lang.String alias)
get a KeyEntry from the store |
abstract KeyEntry |
getKeyEntry(java.lang.String issuer,
java.math.BigInteger serialNo)
get a KeyEntry whose subject certificate has the given issuer and serial number |
abstract TrustedCertificateEntry |
getTrustedCertificateEntry(java.lang.String alias)
get a TrustedCertificateEntry |
abstract TrustedCertificateEntry |
getTrustedCertificateEntry(java.lang.String issuer,
java.math.BigInteger serialNo)
get a TrustedCertificateEntry whose issuer and serial number match those specified |
abstract KeyEntry |
importPKCS12KeyEntry(java.lang.String alias,
byte[] encodedEntry,
PasswordCallback callback)
import a PKCS#12 PrivateKey and associated certificate chain. |
static void |
main(java.lang.String[] args)
provides useful debug output. |
abstract void |
updateEntry(TokenKeyStoreEntry entry)
update an entry on the TokenKeyStore |
void |
validate(java.security.cert.X509Certificate[] chain,
java.util.Date date)
|
abstract void |
validate(java.security.cert.X509Certificate[] chain,
KeyUsages purpose,
java.util.Date date)
validate a certificate chain for a given purpose, on a given data |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROVIDER_PROPERTY
Constructor Detail |
public TokenKeyStore()
Method Detail |
public static TokenKeyStore getInstance(java.lang.String type, java.lang.String location, PasswordCallback callback) throws TokenKeyStoreException
type
- the type of the TokenKeyStore, e.g. "JSS". not nulllocation
- a URL, can be null
callback
- PasswordCallback for logon to token, and also for use if other
actions requiring a password don't explicitly receive a PasswordCallback. may be nullpublic static void main(java.lang.String[] args) throws java.lang.Throwable
If instantiated as
TokenKeyStore
instantiate the TokenKeyStore of the given type, at the given location
using the optional password to authenticate. Then dump a summary of
all entries in the TokenKeyStore
public abstract java.util.Set aliases()
public abstract TokenKeyStoreEntry getEntry(java.lang.String alias) throws NoSuchEntryException, TokenKeyStoreException
the
- alias of the entry to get. not nullpublic abstract TokenKeyStoreEntry getEntry(java.security.cert.X509Certificate cert) throws NoSuchEntryException, TokenKeyStoreException
cert
- the cert to match. not nullpublic abstract TokenKeyStoreEntry getEntry(java.lang.String issuer, java.math.BigInteger serialNo) throws NoSuchEntryException, TokenKeyStoreException
issuer
- an RFC2253 encoded certificate issuer distinguished namea
- certificate serial numberpublic abstract java.util.Set getAllEntries() throws TokenKeyStoreException
public abstract void updateEntry(TokenKeyStoreEntry entry) throws NoSuchEntryException, TokenKeyStoreException
entry
- the entry to update. not nullpublic abstract void deleteEntry(TokenKeyStoreEntry entry) throws NoSuchEntryException, TokenKeyStoreException
entry
- the entry to delete. not nullpublic abstract KeyEntry getKeyEntry(java.lang.String alias) throws NoSuchEntryException, TokenKeyStoreException
alias
- the alias of the entry. not nullpublic abstract KeyEntry getKeyEntry(java.lang.String issuer, java.math.BigInteger serialNo) throws NoSuchEntryException, TokenKeyStoreException
issuer
- an RFC2253 encoded certificate issuer distinguished namea
- certificate serial numberpublic abstract java.util.Set getAllKeyEntries()
public abstract KeyEntry generateKeyPair(java.lang.String alias, java.lang.String subjectName, java.lang.String algorithm, int keysize) throws TokenKeyStoreException
alias
- the alias to assign to the new KeyEntry. may be null, in which case subjectName
will be used as the aliassubjectName
- RFC2253 encoded subject DN of temporary certificate. not nullthe
- algorithm to generate the KeyPair for. not nullkeysize
- key size of the keys to be generatedKeyEntry
public abstract KeyEntry importPKCS12KeyEntry(java.lang.String alias, byte[] encodedEntry, PasswordCallback callback) throws AliasConflictException, IncompleteChainException, TokenKeyStoreException
alias
- the alias to associate with the new KeyEntry. may be null, in which case
the RFC 2253 encoded name of the subject cert will be used as the aliasencodedEntry
- a BER encoded PKCS#12 archive. not nullcallback
- a PasswordCallback to decrypt the archive and to authenticate
the user to the token. may be nullpublic abstract byte[] exportPKCS12KeyEntry(java.lang.String alias, PasswordCallback callback) throws NoSuchEntryException, TokenKeyStoreException
alias
- the KeyEntry to export. not nullcallback
- a PasswordCallback to encrypt the archive and to authenticate
the user to the token. may be nullpublic abstract TrustedCertificateEntry getTrustedCertificateEntry(java.lang.String alias) throws NoSuchEntryException, TokenKeyStoreException
alias
- the alias of the entry. not nullpublic abstract TrustedCertificateEntry getTrustedCertificateEntry(java.lang.String issuer, java.math.BigInteger serialNo) throws NoSuchEntryException, TokenKeyStoreException
issuer
- the RFC2253 encoded issuer name of the certificate. not nullserialNo
- the serial number of the certificate. not nullpublic abstract java.util.Set getAllTrustedCertificateEntries()
public abstract TrustedCertificateEntry addTrustedCertificateEntry(java.lang.String alias, java.security.cert.X509Certificate cert) throws AliasConflictException, TokenKeyStoreException
the
- alias to give the TrustedCertificateEntry. may be null, in which case
the rfc 2253 encoded subject name of the certificate will be used as the aliascert
- the certificate to be trusted. not nullcallback
- a PasswordCallback to authenticate the user to the token. may be nullpublic void validate(java.security.cert.X509Certificate[] chain, java.util.Date date) throws com.iplanet.trustbase.security.cert.ValidateException, TrustException, TokenKeyStoreException
public abstract void validate(java.security.cert.X509Certificate[] chain, KeyUsages purpose, java.util.Date date) throws com.iplanet.trustbase.security.cert.ValidateException, TrustException, TokenKeyStoreException
chain
- the certificate chain. not nullpurpose
- the purpose to validate for. may be null, if TokenKeyStore policy
permits itdate
- the date on which to validate the certificate. may be null,
in which case the current date is assumedcom.iplanet.trustbase.security.cert.ValidateException
- thrown if the certificate chain is invalidTrustException
- thrown if the certificate chain is valid but not trustedpublic abstract java.security.cert.X509Certificate[] completeCertificateChain(java.security.cert.X509Certificate[] partialChain) throws IncompleteChainException, TokenKeyStoreException
partialChain
- the partial certificate chain. must contain at least one
certificateIncompleteChainException
- if the chain cannot be completed using
certificates in the storeTokenKeyStoreException
- public abstract void doCommand(java.lang.String commandVerb, java.lang.String[] arguments) throws TokenKeyStoreException
commandVerb
- a String identifying the action to take. not emptyarguments
- any arguments required by the commandVerb. may be null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |