Code example for SecretKeySpec

0
        // END android-removed 
        { 
            // TODO Should we be ensuring the key is the right length? 
        } 
 
        return new SecretKeySpec(secret, algorithm);
    } 
 
    protected void engineInit( 
        Key                     key,
        AlgorithmParameterSpec  params,
        SecureRandom            random) 
        throws InvalidKeyException, InvalidAlgorithmParameterException 
    { 
        initFromKey(key);
    } 
 
    protected void engineInit( 
        Key             key,
        SecureRandom    random) 
        throws InvalidKeyException