|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.util.crypto.CipherKey
public class CipherKey
A key used in a cryptographic algorithm to encrypt a plain text or to decrypt a cipher text. This key can be either symmetric or asymmetric, it can be provided as such or in a file. This class is a wrapper of the actual representation of the cipher key so that it can be passed to the ciphers in the Silverpeas Cryptography API in different forms, according to the ciphers expectation.
Method Summary | |
---|---|
static CipherKey |
aKeyFromBase64Text(String base64Key)
Constructs a new cipher key from the specified base64 representation of the key. |
static CipherKey |
aKeyFromBinary(byte[] binaryKey)
Constructs a new cipher key from the specified binary representation of the key. |
static CipherKey |
aKeyFromFilePath(String path)
Constructs a new cipher key from the path of the file in which is stored the key. |
static CipherKey |
aKeyFromHexText(String hexKey)
Constructs a new cipher key from the specified hexadecimal representation of the key. |
String |
getKeyFilePath()
Gets the path of the file that stores the key. |
byte[] |
getRawKey()
Gets the raw representation of this cipher key. |
boolean |
isInFile()
Is the key in a file? |
boolean |
isRaw()
Is this cipher key represents a key in itself and not the storage in which the key is? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CipherKey aKeyFromHexText(String hexKey) throws ParseException
hexKey
- the text with hexadecimal-based characters.
ParseException
public static CipherKey aKeyFromBase64Text(String base64Key)
base64Key
- the text of the key in Base64.
public static CipherKey aKeyFromBinary(byte[] binaryKey)
binaryKey
- the key in binary.
public static CipherKey aKeyFromFilePath(String path)
path
- the path of the key file.
public boolean isInFile()
public boolean isRaw()
public byte[] getRawKey()
public String getKeyFilePath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |