|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.cipher.Specification
Class specifying a cipher with its associated password
This basically reduces to a pair cipher name, password
.
Field Summary | |
java.lang.String |
name
The choosen cipher name |
java.lang.String |
password
The choosen password |
Constructor Summary | |
Specification(java.lang.String cipher)
Built a new specification without password. |
|
Specification(java.lang.String cipher,
java.lang.String password)
Built a new specification with specified password. |
Method Summary | |
static boolean |
areFullySpecified(sam.cipher.Specification[] specifications)
|
static sam.cipher.Specification[] |
dropEmpty(sam.cipher.Specification[] specifications)
Drops all specifications whose password is null or empty |
static sam.cipher.Specification[] |
fillIn(java.lang.String[] ciphers,
java.lang.String[] passwords)
Fills cipher and password specifications into an array of Specification s. |
sam.cipher.Cipher |
getCipher(boolean mode)
Instantiates this specification to a proper Cipher |
static sam.cipher.Cipher[] |
getCiphers(sam.cipher.Specification[] specifications,
boolean mode)
Instantiates a specification list to a proper Ciphers list. |
java.lang.String |
getDescription()
Gets the human-readable description of this cipher. |
static java.lang.String[] |
getNames(sam.cipher.Specification[] specifications)
Gets the names of a stack of specifications. |
static sam.cipher.Specification[] |
getRegisteredCiphers()
Gets the list of all currently registerd ciphers as a Specification[] list. |
boolean |
isEmpty()
Wether this specifications is empty, i.e. |
java.lang.String |
toString()
Human-readable specification. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final java.lang.String name
public final transient java.lang.String password
Constructor Detail |
public Specification(java.lang.String cipher)
cipher
- the name of a registered cipherpublic Specification(java.lang.String cipher, java.lang.String password)
cipher
- the name of a registered cipherpassword
- the associated passphraseMethod Detail |
public boolean isEmpty()
public sam.cipher.Cipher getCipher(boolean mode) throws java.lang.Error
Cipher
mode
- wether the cipher should be a ciphering or a deciphering cipher
null
if passwords is null
or empty
java.lang.Error
public java.lang.String toString()
password
in plain text !
toString
in class java.lang.Object
public java.lang.String getDescription()
public static sam.cipher.Cipher[] getCiphers(sam.cipher.Specification[] specifications, boolean mode)
Ciphers
list.
This automatically drops ciphers whose password is null or empty
mode
- wether the cipher should be a ciphering or a deciphering cipher
null
any instantiation fails due to an Error
public static boolean areFullySpecified(sam.cipher.Specification[] specifications)
specifications
is null
public static sam.cipher.Specification[] getRegisteredCiphers()
Specification[]
list.
No default password is ever supplied.
Registry.getCiphers
public static sam.cipher.Specification[] dropEmpty(sam.cipher.Specification[] specifications)
public static java.lang.String[] getNames(sam.cipher.Specification[] specifications)
public static sam.cipher.Specification[] fillIn(java.lang.String[] ciphers, java.lang.String[] passwords)
Specification
s.
Cipher and passwords are matched one-by-one from the first element of each array.
Note that some passwords are allowed to be missing in which case they will get empty;
on the other hand there should not be more passwords than ciphers.
ciphers
- the ordered list of cipherspasswords
- the ordered list of passwords
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |