private KeysetHandle generatePublicKey(KeysetHandle privateKeysetHandle) throws GeneralSecurityException { return privateKeysetHandle.getPublicKeysetHandle(); }
private KeysetHandle generatePublicKey(KeysetHandle privateKeysetHandle) throws GeneralSecurityException { return privateKeysetHandle.getPublicKeysetHandle(); }
private KeysetHandle generatePublicKey(KeysetHandle privateKeysetHandle) throws GeneralSecurityException { return privateKeysetHandle.getPublicKeysetHandle(); }
/** * Stores the public keyset in the projects resources/keysets directory if it does not exist yet. * * @throws IOException Failure during saving * @throws GeneralSecurityException Failure during keyset generation */ private void generateAndStorePublicKey(KeysetHandle privateKeysetHandle) throws IOException, GeneralSecurityException { KeysetHandle keysetHandle = privateKeysetHandle.getPublicKeysetHandle(); File keysetFile = new File(PUBLIC_KEYSET_FILENAME); if (!keysetFile.exists()) { CleartextKeysetHandle.write(keysetHandle, JsonKeysetWriter.withFile(keysetFile)); } }
private static void generateEcdsaKeyPair(File publicKeyFile, File privatekeyFile) throws GeneralSecurityException, IOException { KeysetHandle privateKeyHandle = KeysetHandle.generateNew(SIGNATURE_KEY_TEMPLATE); CleartextKeysetHandle.write(privateKeyHandle, BinaryKeysetWriter.withFile(privatekeyFile)); KeysetHandle publicKeyHandle = privateKeyHandle.getPublicKeysetHandle(); CleartextKeysetHandle.write(publicKeyHandle, BinaryKeysetWriter.withFile(publicKeyFile)); } }