SecretKeySpec


SecretKeySpec javax.crypto.spec

Java 1.4 serializable

This class is a transparent and algorithm-independent representation of a secret key. This class is useful only for encryption algorithms (such as DES and DESede) whose secret keys can be represented as arbitrary byte arrays and do not require auxiliary parameters. Note that SecretKeySpec implements the javax.crypto.SecretKey interface directly, so no algorithm-specific javax.crypto.SecretKeyFactory object is required.

Figure 17-27. javax.crypto.spec.SecretKeySpec

 public class  SecretKeySpec  implements java.security.spec.KeySpec, javax.crypto.SecretKey {  // Public Constructors  public  SecretKeySpec  (byte[ ]  key  , String  algorithm  );        public  SecretKeySpec  (byte[ ]  key  , int  offset  , int  len  , String  algorithm  );  // Methods Implementing Key  public String  getAlgorithm  ( );        public byte[ ]  getEncoded  ( );        public String  getFormat  ( );  // Public Methods Overriding Object  public boolean  equals  (Object  obj  );        public int  hashCode  ( );   } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net