public class SecureTokenUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
encodeDomainKey(long keyId,
javax.crypto.SecretKey key)
Encode a key as a byte array for transmission over a network
connection.
|
static byte[] |
encodeMasterPrivateKey(long keyId,
java.security.PrivateKey privKey)
Encode a master private key for storage.
|
static byte[] |
encodeMasterPublicKey(long keyId,
java.security.PublicKey pubKey)
Encode a master public key for storage.
|
static javax.crypto.SecretKey |
generateDomainKey()
Generate a key to be used as the domain key.
|
static java.security.KeyPair |
generateMasterKeyPair()
Generate a public/private keypair to be used as a master key.
|
static void |
main(java.lang.String[] args)
Generate a new master key with the id specified in args
|
public static javax.crypto.SecretKey generateDomainKey()
public static byte[] encodeDomainKey(long keyId, javax.crypto.SecretKey key)
public static java.security.KeyPair generateMasterKeyPair()
public static byte[] encodeMasterPrivateKey(long keyId, java.security.PrivateKey privKey)
public static byte[] encodeMasterPublicKey(long keyId, java.security.PublicKey pubKey)
public static void main(java.lang.String[] args)