FileDocCategorySizeDatePackage
XORKey.javaAPI DocExample601Sat Jan 13 13:07:24 GMT 2001javasec.samples.ch09

XORKey

public class XORKey extends Object implements SecretKey

Fields Summary
int
rotValue
Constructors Summary
XORKey(int value)

        rotValue = value;
    
Methods Summary
public java.lang.StringgetAlgorithm()

        return "XOR";
    
public byte[]getEncoded()

        byte b[] = new byte[4];
        b[3] = (byte) ((rotValue << 24) & 0xff);
        b[2] = (byte) ((rotValue << 16) & 0xff);
        b[1] = (byte) ((rotValue <<  8) & 0xff);
        b[0] = (byte) ((rotValue <<  0) & 0xff);
        return b;
    
public java.lang.StringgetFormat()

        return "XOR Special Format";