Class KeySecret
- java.lang.Object
- 
- jadex.platform.service.security.auth.AbstractAuthenticationSecret
- 
- jadex.platform.service.security.auth.SharedSecret
- 
- jadex.platform.service.security.auth.KeySecret
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class KeySecret extends SharedSecret Authentication secret based on a shared key.
- 
- 
Field SummaryFields Modifier and Type Field Description protected byte[]keyThe password.protected static intMIN_KEY_LENGTHKey length warning threshold.static java.lang.StringPREFIXPrefix used to encode secret type as strings.- 
Fields inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecretSECRET_TYPES
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeySecretcreateRandom()Creates a random shared key.static java.lang.StringcreateRandomAsString()Creates a random shared key.byte[]deriveKey(int keysize, byte[] salt)Derives a key from the shared secret using a salt.byte[]getKey()Gets the key.voidsetKey(byte[] key)Sets the key.java.lang.StringtoString()Creates encoded secret.- 
Methods inherited from class jadex.platform.service.security.auth.SharedSecretcanSign
 - 
Methods inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecretclone, equals, fromKeyPair, fromString, fromString, hashCode, main
 
- 
 
- 
- 
- 
Field Detail- 
PREFIXpublic static final java.lang.String PREFIX Prefix used to encode secret type as strings.- See Also:
- Constant Field Values
 
 - 
MIN_KEY_LENGTHprotected static final int MIN_KEY_LENGTH Key length warning threshold.- See Also:
- Constant Field Values
 
 - 
keyprotected byte[] key The password.
 
- 
 - 
Method Detail- 
getKeypublic byte[] getKey() Gets the key.- Returns:
- The key.
 
 - 
setKeypublic void setKey(byte[] key) Sets the key.- Parameters:
- key- The key.
 
 - 
deriveKeypublic byte[] deriveKey(int keysize, byte[] salt)Derives a key from the shared secret using a salt.- Specified by:
- deriveKeyin class- SharedSecret
- Parameters:
- keysize- The target key size in bytes to generate.
- salt- Salt to use.
- df- Used derivation function.
- Returns:
- Derived key.
 
 - 
toStringpublic java.lang.String toString() Creates encoded secret.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- Encoded secret.
 
 - 
createRandompublic static final KeySecret createRandom() Creates a random shared key.- Returns:
- Random shared key.
 
 - 
createRandomAsStringpublic static final java.lang.String createRandomAsString() Creates a random shared key.- Returns:
- Random shared key.
 
 
- 
 
-