|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.crypto.FilesystemKeyPairProvider
public class FilesystemKeyPairProvider
Looks for private keys and their according certificates in a file system folder.
Certificates need to be base64 + DER-encoded files with the.cer
file name extension.
Private keys need to be base64 + PKCS #8-encoded with the .key
file name extension.
A certificate and its according private key have to share a common file name that is used as the alias name during
key pair lookup.
Constructor Summary | |
---|---|
FilesystemKeyPairProvider()
|
Method Summary | |
---|---|
String |
getFilePath()
|
Map<String,String> |
getPassphrasesByAlias()
|
void |
init()
|
KeyPair |
resolveByAlias(String alias,
char[] password)
Resolves a keypair by an alias. |
KeyPair |
resolveByCertificate(Certificate cert,
char[] password)
Resolves a key pair by a given certificate. |
KeyPair |
resolveBySerialIssuer(String issuerDN,
BigInteger serial,
char[] password)
Resolves a key pair by a SerialIssuer, this is required to resolve certificates and it's private keys by the id of the certificate. |
void |
setFilePath(String filePath)
|
void |
setPassphrasesByAlias(Map<String,String> passphrasesByAlias)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilesystemKeyPairProvider()
Method Detail |
---|
public void init()
public KeyPair resolveByAlias(String alias, char[] password) throws KeyPairResolvingException
KeyPairProvider
resolveByAlias
in interface KeyPairProvider
alias
- the alias.password
- a password for the private key, can be null.
KeyPairResolvingException
- if keypair can't be resolved.public KeyPair resolveBySerialIssuer(String issuerDN, BigInteger serial, char[] password)
KeyPairProvider
resolveBySerialIssuer
in interface KeyPairProvider
issuerDN
- the issuerDN.serial
- the serial.password
- a password for the private key, can be null.
public KeyPair resolveByCertificate(Certificate cert, char[] password) throws KeyPairResolvingException
KeyPairProvider
resolveByCertificate
in interface KeyPairProvider
cert
- the cert.password
- a password for the private key, can be null.
KeyPairResolvingException
- if error occurs.public String getFilePath()
public void setFilePath(String filePath)
public void setPassphrasesByAlias(Map<String,String> passphrasesByAlias)
public Map<String,String> getPassphrasesByAlias()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |