Crypter crypter = null;
GenericKeyczar store = keyczarFactory.find(Secrets.KEY_TOKEN_ENCRYPT, crypter);
if (store == null) {
String nameFlag = "Authentication Token Encryption";
KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.RSA_PRIV);
store = keyczarFactory.create(Secrets.KEY_TOKEN_ENCRYPT, kmd, crypter);
}
keyczarFactory.ensureKeyCreated(store);
}
{
Crypter crypter = null;
GenericKeyczar store = keyczarFactory.find(SharedSecretTokenService.KEYSTORE_ID, crypter);
if (store == null) {
String nameFlag = "Authentication Token Signing";
KeyMetadata kmd = new KeyMetadata(nameFlag, KeyPurpose.SIGN_AND_VERIFY, DefaultKeyType.HMAC_SHA1);
store = keyczarFactory.create(SharedSecretTokenService.KEYSTORE_ID, kmd, crypter);
}
keyczarFactory.ensureKeyCreated(store);
}