RsaSsaPssSignKeyManager extends PrivateKeyTypeManager<RsaSsaPssPrivateKey, RsaSsaPssPublicKey> { public static final KeyTemplate rsa4096PssSha512F4Template() { return createKeyTemplate( HashType.SHA512, HashType.SHA512, 64, 4096, RSAKeyGenParameterSpec.F4, KeyTemplate.OutputPrefixType.TINK); } RsaSsaPssSignKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override RsaSsaPssPublicKey getPublicKey(RsaSsaPssPrivateKey privKeyProto); @Override KeyMaterialType keyMaterialType(); @Override RsaSsaPssPrivateKey parseKey(ByteString byteString); @Override void validateKey(RsaSsaPssPrivateKey keyProto); @Override KeyFactory<RsaSsaPssKeyFormat, RsaSsaPssPrivateKey> keyFactory(); static void registerPair(boolean newKeyAllowed); static final KeyTemplate rsa3072PssSha256F4Template(); static final KeyTemplate rawRsa3072PssSha256F4Template(); static final KeyTemplate rsa4096PssSha512F4Template(); static final KeyTemplate rawRsa4096PssSha512F4Template();  }
@Test public void testRsa4096PssSha512F4Template() throws Exception { KeyTemplate template = RsaSsaPssSignKeyManager.rsa4096PssSha512F4Template(); assertThat(template.getTypeUrl()).isEqualTo(new RsaSsaPssSignKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.TINK); RsaSsaPssKeyFormat format = RsaSsaPssKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.hasParams()).isTrue(); assertThat(format.getParams().getSigHash()).isEqualTo(HashType.SHA512); assertThat(format.getParams().getMgf1Hash()).isEqualTo(HashType.SHA512); assertThat(format.getParams().getSaltLength()).isEqualTo(64); assertThat(format.getModulusSizeInBits()).isEqualTo(4096); assertThat(new BigInteger(1, format.getPublicExponent().toByteArray())) .isEqualTo(BigInteger.valueOf(65537)); }