|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensc.pkcs11.PKCS11LoadStoreParameter
public class PKCS11LoadStoreParameter
An instance of this class should be passed to the function KeyStore.load() in order to configure PKCS11 store loading with parameters appropriate for cyrptographic tokens.
KeyStore.load(java.security.KeyStore.LoadStoreParameter)| Constructor Summary | |
|---|---|
PKCS11LoadStoreParameter()
Constructs a PKCS11LoadStoreParameter instance using default settings. |
|
| Method Summary | |
|---|---|
CallbackHandler |
getEventHandler()
|
KeyStore.ProtectionParameter |
getProtectionParameter()
|
Long |
getSlotId()
|
KeyStore.ProtectionParameter |
getSOProtectionParameter()
|
boolean |
isWaitForSlot()
|
boolean |
isWriteEnabled()
|
void |
setEventHandler(CallbackHandler eventHandler)
Sets the CallbackHandler, which receives
callbacks of type PKCS11EventCallback. |
void |
setProtectionCallback(CallbackHandler handler)
This is a convenience function for setting a callback protection to the protection parameter. |
void |
setProtectionParameter(KeyStore.ProtectionParameter protectionParameter)
|
void |
setProtectionPIN(char[] pin)
This is a convenience function for setting a password protection to the protection parameter. |
void |
setSlotId(Long slotId)
|
void |
setSOProtectionCallback(CallbackHandler handler)
This is a convenience function for setting a callback protection to the SO protection parameter. |
void |
setSOProtectionParameter(KeyStore.ProtectionParameter protectionParameter)
|
void |
setSOProtectionPIN(char[] pin)
This is a convenience function for setting a password protection to the SO protection parameter. |
void |
setWaitForSlot(boolean waitForSlot)
|
void |
setWriteEnabled(boolean writeEnabled)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PKCS11LoadStoreParameter()
| Method Detail |
|---|
public KeyStore.ProtectionParameter getProtectionParameter()
getProtectionParameter in interface KeyStore.LoadStoreParameterpublic void setProtectionParameter(KeyStore.ProtectionParameter protectionParameter)
protectionParameter - The protectionParameter for the normal user to set
A protection parameter for a normal user
is needed for signing as well as for listing
private keys on the token.KeyStore.PasswordProtection,
KeyStore.CallbackHandlerProtection,
PasswordCallbackpublic void setProtectionPIN(char[] pin)
this.setProtectionParameter(new PasswordProtection(pin)).
pin - The pin to present to the token.PKCS11LoadStoreParameter#setProtectionParameter(ProtectionParameter)public void setProtectionCallback(CallbackHandler handler)
PasswordCallback.
Equivalent to calling
this.setProtectionParameter(new CallbackHandlerProtection(handler)).
handler - The callback handler for querying the PIN from the user by means
of a PasswordCallback.PKCS11LoadStoreParameter#setProtectionParameter(ProtectionParameter),
PasswordCallback,
KeyStore.CallbackHandlerProtectionpublic KeyStore.ProtectionParameter getSOProtectionParameter()
public void setSOProtectionParameter(KeyStore.ProtectionParameter protectionParameter)
protectionParameter - The security officer protection parameter to
be used. A SO protection parameter is used,
when the token is opened in read/write mode.KeyStore.PasswordProtection,
KeyStore.CallbackHandlerProtection,
PasswordCallbackpublic void setSOProtectionPIN(char[] pin)
this.setSOProtectionParameter(new PasswordProtection(pin)).
pin - The SO pin to present to the token.PKCS11LoadStoreParameter#setSOProtectionParameter(ProtectionParameter)public void setSOProtectionCallback(CallbackHandler handler)
PasswordCallback.
Equivalent to calling
this.setSOProtectionParameter(new CallbackHandlerProtection(handler)).
handler - The callback handler for querying the SO PIN from the user by means
of a PasswordCallback.PKCS11LoadStoreParameter#setSOProtectionParameter(ProtectionParameter),
PasswordCallback,
KeyStore.CallbackHandlerProtectionpublic CallbackHandler getEventHandler()
CallbackHandler, which receives
callbacks of type PKCS11EventCallback. This handler my be used
in order to display some helpful information to the user while the
KeyStore is performing the authentication against the token.PKCS11EventCallbackpublic void setEventHandler(CallbackHandler eventHandler)
CallbackHandler, which receives
callbacks of type PKCS11EventCallback.
eventHandler - The CallbackHandler to set.getEventHandler(),
PKCS11EventCallbackpublic Long getSlotId()
public void setSlotId(Long slotId)
slotId - Set the ID of the slot to be opened.
If set to null, the KeyStore opens the first slot
with a present token.public boolean isWaitForSlot()
public void setWaitForSlot(boolean waitForSlot)
waitForSlot - Set, whether the KeyStore should wait for a token
to be inserted if no token is found.public boolean isWriteEnabled()
public void setWriteEnabled(boolean writeEnabled)
writeEnabled - Set, whether the token should be opened in read/write mode
instead of read-only mode.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||