Methods Summary |
---|
protected java.security.PrivateKey | engineGeneratePrivate(java.security.spec.KeySpec ks)
if (!(ks instanceof XYZKeySpec))
throw new InvalidKeySpecException("Expecting XYZKeySpec");
XYZKey k = new XYZKey();
k.rotValue = ((XYZKeySpec) ks).rotValue;
return k;
|
protected java.security.PublicKey | engineGeneratePublic(java.security.spec.KeySpec ks)
// Convert from the key spec to the key. In our case, the
// spec holds the rot value, so we can just construct the
// key
if (!(ks instanceof XYZKeySpec))
throw new InvalidKeySpecException("Expecting XYZKeySpec");
XYZKey k = new XYZKey();
k.rotValue = ((XYZKeySpec) ks).rotValue;
return k;
|
protected java.security.spec.KeySpec | engineGetKeySpec(java.security.Key key, java.lang.Class specClass)
if (specClass != XYZKeySpec.class)
throw new InvalidKeySpecException("Expecting XYZKeySpec");
if (!(key instanceof XYZKey))
throw new IllegalArgumentException("Expecting XYZ Key");
return new XYZKeySpec((XYZKey) key);
|
protected java.security.Key | engineTranslateKey(java.security.Key key)
// Translate key formats by getting the encoded key and creating
// the type of key we know about.
XYZKey k = new XYZKey();
if (k.getFormat() != key.getFormat())
throw new InvalidKeyException("Expecting XYZ Special Format Key");
byte[] b = key.getEncoded();
k.rotValue = (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];
return k;
|