xades4j.providers.impl
Class PKCS11KeyStoreKeyingDataProvider
java.lang.Object
xades4j.providers.impl.KeyStoreKeyingDataProvider
xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider
- All Implemented Interfaces:
- KeyingDataProvider
public class PKCS11KeyStoreKeyingDataProvider
- extends KeyStoreKeyingDataProvider
A specification of KeyStoreKeyingDataProvider for PKCS#11 keystores.
This class uses the SUN's PKCS#11 provider, which brigdes with the native PKCS#11
library.
The KeyStorePasswordProvider and KeyEntryPasswordProvider may
be null. In that case the keystore protection has to be handled by the
native library. If the KeyEntryPasswordProvider is supplied, the protection
used to access an entry is a CallbackHandlerProtection that invokes the
KeyEntryPasswordProvider exactly when when the password is requested.
- Author:
- Luís
- See Also:
KeyStoreKeyingDataProvider
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PKCS11KeyStoreKeyingDataProvider
public PKCS11KeyStoreKeyingDataProvider(String nativeLibraryPath,
String providerName,
KeyStoreKeyingDataProvider.SigningCertSelector certificateSelector,
KeyStoreKeyingDataProvider.KeyStorePasswordProvider keyStorePasswordProvider,
KeyStoreKeyingDataProvider.KeyEntryPasswordProvider entryPasswordProvider,
boolean returnFullChain)
throws KeyStoreException
- Parameters:
nativeLibraryPath - the path for the native library of the specific PKCS#11 providerproviderName - this string is concatenated with the prefix SunPKCS11- to produce this provider instance's namecertificateSelector - the selector of signing certificatekeyStorePasswordProvider - the provider of the keystore loading password (may be null)entryPasswordProvider - the provider of entry passwords (may be null)returnFullChain - indicates of the full certificate chain should be returned, if available
- Throws:
KeyStoreException
PKCS11KeyStoreKeyingDataProvider
public PKCS11KeyStoreKeyingDataProvider(String nativeLibraryPath,
String providerName,
KeyStoreKeyingDataProvider.SigningCertSelector certificateSelector)
throws KeyStoreException
- Shortcut for the other constructor using
null for the password providers and false
for the returnFullChain parameter.
- Parameters:
nativeLibraryPath - providerName - certificateSelector -
- Throws:
KeyStoreException
getKeyProtection
protected final KeyStore.ProtectionParameter getKeyProtection(String entryAlias,
X509Certificate entryCert,
KeyStoreKeyingDataProvider.KeyEntryPasswordProvider entryPasswordProvider)
- Description copied from class:
KeyStoreKeyingDataProvider
- Gets a protection parameter to access the specified entry.
- Specified by:
getKeyProtection in class KeyStoreKeyingDataProvider
- Parameters:
entryAlias - the alias of the entry that is being accessedentryCert - the cerificate in the entryentryPasswordProvider - the password provider that should be used to
get the actual password (may be null)
- Returns:
- the protection
Copyright © 2012. All Rights Reserved.