Package eu.europa.esig.dss.token
Class KSPrivateKeyEntry
- java.lang.Object
-
- eu.europa.esig.dss.token.KSPrivateKeyEntry
-
- All Implemented Interfaces:
DSSPrivateKeyEntry
public class KSPrivateKeyEntry extends Object implements DSSPrivateKeyEntry
Wrapper of a PrivateKeyEntry coming from a KeyStore.
-
-
Constructor Summary
Constructors Constructor Description KSPrivateKeyEntry(String alias, KeyStore.PrivateKeyEntry privateKeyEntry)The default constructor for KSPrivateKeyEntry.
-
Method Summary
Modifier and Type Method Description StringgetAlias()Get the entry aliasCertificateTokengetCertificate()Retrieve the signing certificateCertificateToken[]getCertificateChain()Retrieve the certificate chain linkedEncryptionAlgorithmgetEncryptionAlgorithm()Get the EncryptionAlgorithm corresponding to the PrivateKeyPrivateKeygetPrivateKey()Get the private key
-
-
-
Constructor Detail
-
KSPrivateKeyEntry
public KSPrivateKeyEntry(String alias, KeyStore.PrivateKeyEntry privateKeyEntry)
The default constructor for KSPrivateKeyEntry.- Parameters:
alias- the given aliasprivateKeyEntry- the keystore private key entry
-
-
Method Detail
-
getAlias
public String getAlias()
Get the entry alias- Returns:
- the alias
-
getCertificate
public CertificateToken getCertificate()
Description copied from interface:DSSPrivateKeyEntryRetrieve the signing certificate- Specified by:
getCertificatein interfaceDSSPrivateKeyEntry- Returns:
- the certificate
-
getCertificateChain
public CertificateToken[] getCertificateChain()
Description copied from interface:DSSPrivateKeyEntryRetrieve the certificate chain linked- Specified by:
getCertificateChainin interfaceDSSPrivateKeyEntry- Returns:
- the chain of certificates
-
getPrivateKey
public PrivateKey getPrivateKey()
Get the private key- Returns:
- the private key
-
getEncryptionAlgorithm
public EncryptionAlgorithm getEncryptionAlgorithm() throws DSSException
Description copied from interface:DSSPrivateKeyEntryGet the EncryptionAlgorithm corresponding to the PrivateKey- Specified by:
getEncryptionAlgorithmin interfaceDSSPrivateKeyEntry- Returns:
- the EncryptionAlgorithm (RSA, ECDSA,...)
- Throws:
DSSException- if the encryption algorithm cannot be detected
-
-