Class PasswordSecret
- java.lang.Object
- 
- jadex.platform.service.security.auth.AbstractAuthenticationSecret
- 
- jadex.platform.service.security.auth.SharedSecret
- 
- jadex.platform.service.security.auth.PasswordSecret
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class PasswordSecret extends SharedSecret A secret password used for authentication.
- 
- 
Field SummaryFields Modifier and Type Field Description static intMIN_GOOD_PASSWORD_LENGTHPassword length weakness threshold.protected java.lang.StringpasswordThe password.static java.lang.StringPREFIXPrefix used to encode secret type as strings.protected static intSCRYPT_NSCrypt work factor / hardness for password strengthening.protected static intSCRYPT_PSCrypt parallelization.protected static intSCRYPT_RSCrypt block size.- 
Fields inherited from class jadex.platform.service.security.auth.AbstractAuthenticationSecretSECRET_TYPES
 
- 
 - 
Constructor SummaryConstructors Constructor Description PasswordSecret()Creates the secret.PasswordSecret(java.lang.String encodedpassword)Creates the secret.PasswordSecret(java.lang.String password, boolean encoded)Creates the secret.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]deriveKey(int keysize, byte[] salt)Derives a key from the password with appropriate hardening.byte[]deriveKey(int keysize, byte[] salt, byte[] dfparams)Derives a key from the password with appropriate hardening.byte[]getKdfParams()Gets the key derivation parameters.java.lang.StringgetPassword()Gets the password.booleanisWeak()Returns if the password is weak.static voidmain(java.lang.String[] args)voidsetPassword(java.lang.String password)Sets the password.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
 
- 
 
- 
- 
- 
Field Detail- 
MIN_GOOD_PASSWORD_LENGTHpublic static final int MIN_GOOD_PASSWORD_LENGTH Password length weakness threshold.- See Also:
- Constant Field Values
 
 - 
PREFIXpublic static final java.lang.String PREFIX Prefix used to encode secret type as strings.- See Also:
- Constant Field Values
 
 - 
SCRYPT_Nprotected static final int SCRYPT_N SCrypt work factor / hardness for password strengthening.- See Also:
- Constant Field Values
 
 - 
SCRYPT_Rprotected static final int SCRYPT_R SCrypt block size.- See Also:
- Constant Field Values
 
 - 
SCRYPT_Pprotected static final int SCRYPT_P SCrypt parallelization.- See Also:
- Constant Field Values
 
 - 
passwordprotected java.lang.String password The password.
 
- 
 - 
Method Detail- 
getPasswordpublic java.lang.String getPassword() Gets the password.- Returns:
- The password.
 
 - 
setPasswordpublic void setPassword(java.lang.String password) Sets the password.- Parameters:
- password- The password.
 
 - 
getKdfParamspublic byte[] getKdfParams() Gets the key derivation parameters.- Returns:
- Key derivation parameters.
 
 - 
deriveKeypublic byte[] deriveKey(int keysize, byte[] salt)Derives a key from the password with appropriate hardening.- Specified by:
- deriveKeyin class- SharedSecret
- Parameters:
- keysize- The target key size in bytes to generate.
- salt- Salt to use.
- Returns:
- Derived key.
 
 - 
deriveKeypublic byte[] deriveKey(int keysize, byte[] salt, byte[] dfparams)Derives a key from the password with appropriate hardening.- Parameters:
- keysize- The target key size in bytes to generate.
- salt- Salt to use.
- dfparams- Key derivation parameters.
- Returns:
- Derived key.
 
 - 
isWeakpublic boolean isWeak() Returns if the password is weak.- Returns:
- True, if weak.
 
 - 
toStringpublic java.lang.String toString() Creates encoded secret.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- Encoded secret.
 
 - 
mainpublic static void main(java.lang.String[] args) 
 
- 
 
-