Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Razumain committed Nov 29, 2018
1 parent 83c41f4 commit bcea43b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,25 @@ Example:
"alias","1234");


Following this example, the default procedure for extracting the private key object from the HSM provider is used. For some implementations of HSM it may be necessary to provide custom code for extracting the private key handler object from the HSM by providing an implementation of the interface `CustomKeyExtractor`.

Example:

samlMessageSigningCredential = new PKCS11Credential(
x509Cert,
pkcs11Provider.getProviderNameList(),
"alias",
new CustomKeyExtractor() {
@Override
public PrivateKey getPrivateKey(String providerName, String alias) throws Exception {
KeyStore keyStore = KeyStore.getInstance("PKCS11", providerName);
keyStore.load(null, "1234".toCharArray());
return (PrivateKey) keyStore.getKey(alias, "1234".toCharArray());
}
}
);


------

Copyright © 2018, [Sweden Connect](https://swedenconnect.se). Licensed under version 2.0 of the [Apache License](http://www.apache.org/licenses/LICENSE-2.0).
Expand Down

0 comments on commit bcea43b

Please sign in to comment.