|
TrueLicense Core 1.33 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.license.PrivacyGuard
public class PrivacyGuard
This class provides encoding and encryption services to provide long time
persistence for GenericCertificates and protect the privacy of its
data.
This class is not thread safe.
| Field Summary | |
|---|---|
private AlgorithmParameterSpec |
algoParamSpec
|
private Cipher |
cipher
|
private SecretKey |
key
|
private CipherParam |
param
|
private static String |
PBE_WITH_MD5_AND_DES
|
| Constructor Summary | |
|---|---|
protected |
PrivacyGuard()
Creates a new Privacy Guard. |
|
PrivacyGuard(CipherParam param)
Creates a new Privacy Guard. |
| Method Summary | |
|---|---|
byte[] |
cert2key(GenericCertificate certificate)
Encodes, compresses and encrypts the given license certificate and returns the result as a license key. |
CipherParam |
getCipherParam()
Returns the cipher configuration parameters. |
GenericCertificate |
key2cert(byte[] key)
Decrypts, decompresses and decodes the given license key and returns the result as a license certificate. |
void |
setCipherParam(CipherParam param)
Sets the cipher configuration parameters. |
private void |
setCipherParam0(CipherParam param)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private AlgorithmParameterSpec algoParamSpec
private Cipher cipher
private SecretKey key
private CipherParam param
private static final String PBE_WITH_MD5_AND_DES
| Constructor Detail |
|---|
protected PrivacyGuard()
Warning: The guard created by this constructor is not
valid and cannot be used unless setCipherParam(CipherParam)
is called!
public PrivacyGuard(CipherParam param)
param - The cipher configuration parameters
- may not be null.| Method Detail |
|---|
public byte[] cert2key(GenericCertificate certificate)
throws Exception
certificate - The license certificate
- may not be null.
null is never returned.
Exception - An instance of a subclass of this class for various
reasons.
Note that you should always use
Throwable.getLocalizedMessage() to get a (possibly
localized) meaningful detail message.public CipherParam getCipherParam()
public GenericCertificate key2cert(byte[] key)
throws Exception
key - The license key to process
- may not be null.
null is never returned.
Exception - An instance of a subclass of this class for various
reasons.
Note that you should always use
Throwable.getLocalizedMessage() to get a (possibly
localized) meaningful detail message.public void setCipherParam(CipherParam param)
param - the cipher configuration parameters
- may not be null.
NullPointerException - if the given parameter object does not
obey the contract of its interface due to a null
pointer.
IllegalPasswordException - if any password in the parameter object
does not comply to the current policy.private void setCipherParam0(CipherParam param)
|
TrueLicense Core 1.33 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||