|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.util.crypto.CMSCipher
public class CMSCipher
The Cryptographic Message Syntax (CMS) is the IETF's standard for cryptographically protected messages. It can be used to digitally sign, digest, authenticate or encrypt any form of digital data. It is based on the syntax of PKCS#7, which in turn is based on the Privacy-Enhanced Mail standard. The newest version of CMS (as of 2009) is specified in RFC 5652 (but see also RFC 5911 for updated ASN.1 modules conforming to ASN.1 2002).
The architecture of CMS is built around certificate-based key management, such as the profile defined by the PKIX working group. CMS is used as the key cryptographic component of many other cryptographic standards, such as S/MIME, PKCS#12 and the RFC 3161 Digital timestamping protocol. This implementation wraps the all the mechanism required to encrypt and to decrypt messages within a PKS/CMS infrastructure. For doing it uses the public key, the secret key and the X509 certificate provided by a PKS#12 key store (an instance of the PKS12KeyStore class). Instances of this class is for signing and encrypting, and checking and decrypting data exchanged between two interlocutors.
Constructor Summary | |
---|---|
protected |
CMSCipher()
|
Method Summary | |
---|---|
String |
decrypt(byte[] encryptedData,
CipherKey keyFilePath)
Decrypt the specified code or cipher by using the specified cryptographic key. |
byte[] |
encrypt(String data,
CipherKey keyFilePath)
Encrypts the specified data by using the specified cryptographic key. |
CipherKey |
generateCipherKey()
This operation isn't yet supported by this cipher. |
CryptographicAlgorithmName |
getAlgorithmName()
Gets the name of the algorithm of the cipher. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CMSCipher()
Method Detail |
---|
public CryptographicAlgorithmName getAlgorithmName()
getAlgorithmName
in interface Cipher
public byte[] encrypt(String data, CipherKey keyFilePath) throws CryptoException
encrypt
in interface Cipher
data
- the data to encode.keyFilePath
- the file in which is stored the public key to use in the encryption.
CryptoException
- if an error has occurred in the data encryption.public String decrypt(byte[] encryptedData, CipherKey keyFilePath) throws CryptoException
decrypt
in interface Cipher
encryptedData
- the data in bytes that was encrypted by this cipher.keyFilePath
- the file in which is stored the secret key to use in the decryption.
CryptoException
- if an error has occurred in the data decryption.public CipherKey generateCipherKey() throws CryptoException
generateCipherKey
in interface Cipher
CryptoException
- if an error has occurred in the key generation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |