Class SecretKey
java.lang.Object
com.codename1.security.Key
com.codename1.security.SecretKey
A symmetric secret key. Used with Cipher (AES) and Hmac (via raw
bytes). For asymmetric algorithms use PublicKey / PrivateKey.
Keys carry the raw key material plus the algorithm name they are intended
for. They do not enforce length or strength -- that is the caller's
responsibility, although KeyGenerator will produce keys of standard
lengths.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Key
getAlgorithm, getEncoded, getFormat
-
Constructor Details
-
SecretKey
Wraps existing key material.
Parameters
-
algorithm: algorithm identifier (e.g. "AES") -
keyBytes: raw key material -- defensively copied
-
-
-
Method Details
-
getBitLength
public int getBitLength()Returns the length of the key in bits.
-