Code example for DESedeKeySpec

0
 
    private String cipherAlgorithm = DEFAULT_ENCRYPTION_ALGORITHM;
 
    public final void setSecretKey(final String key) throws NoSuchAlgorithmException, InvalidKeyException,
            InvalidKeySpecException { 
        this.key = SecretKeyFactory.getInstance(this.cipherAlgorithm).generateSecret(new DESedeKeySpec(key.getBytes()));
    } 
 
    public final void setSecretKey(final Key key) {
        this.key = key;
    } 
 
    /** 
     * Note: you MUST call this method before calling setSecretKey if you're not using the default algorithm.  You've been warned. 
     * 
     * @param cipherAlgorithm the cipher algorithm. 
     */ 
    public final void setCipherAlgorithm(final String cipherAlgorithm) {
        this.cipherAlgorithm = cipherAlgorithm;
    } 
Connect your IDE to all the code out there  Get Codota for Java