Class PKS12KeyStore
- java.lang.Object
-
- org.silverpeas.core.security.encryption.cipher.PKS12KeyStore
-
public class PKS12KeyStore extends Object
A key store of the public and secret keys, and of the X509 certificate in a PKS infrastructure.The PKS (Public-Key Cryptography Standards) is a group of standards in cryptography that are under the control of the the RSA Security company. The standards promote a cryptographic infrastructure for the identification of users, the signature and the exchange of data.
The format used to store the private key and the public key certificate is described in the PKS#12 specification written by the RSA Security company in California.
-
-
Constructor Summary
Constructors Constructor Description PKS12KeyStore(String p12FilePath, String password)
Constructs a new PKS#12 key store from the specified key store file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X509Certificate
getCertificate()
Gets the X509 certificate in this PKS#12 key store.PrivateKey
getPrivatekey()
Gets the private key in this PKS#12 key store.PublicKey
getPublickey()
Gets the public key in this PKS#12 key store.
-
-
-
Constructor Detail
-
PKS12KeyStore
public PKS12KeyStore(String p12FilePath, String password) throws KeyStoreException, CryptoException
Constructs a new PKS#12 key store from the specified key store file.It loads the secret and public key as well the X509 certificate from the specified file.
- Parameters:
p12FilePath
- the path of the PKS#12 key store file.password
- the password which protects the key store file.- Throws:
KeyStoreException
- if an error occurs while opening the PKS#12 key store file.CryptoException
- if an error occurs while loading the keys and the certificate from the PKS#12 key store file.
-
-
Method Detail
-
getCertificate
public X509Certificate getCertificate()
Gets the X509 certificate in this PKS#12 key store.- Returns:
- an X509Certificate instance.
-
getPrivatekey
public PrivateKey getPrivatekey()
Gets the private key in this PKS#12 key store.- Returns:
- a PrivateKey instance.
-
getPublickey
public PublicKey getPublickey()
Gets the public key in this PKS#12 key store.- Returns:
- a PublicKey instance.
-
-