RsaSsaPkcs1SignKeyManager extends PrivateKeyTypeManager<RsaSsaPkcs1PrivateKey, RsaSsaPkcs1PublicKey> { public static final KeyTemplate rawRsa4096SsaPkcs1Sha512F4Template() { return createKeyTemplate( HashType.SHA512, 4096, RSAKeyGenParameterSpec.F4, KeyTemplate.OutputPrefixType.RAW); } RsaSsaPkcs1SignKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override RsaSsaPkcs1PublicKey getPublicKey(RsaSsaPkcs1PrivateKey privKeyProto); @Override KeyMaterialType keyMaterialType(); @Override RsaSsaPkcs1PrivateKey parseKey(ByteString byteString); @Override void validateKey(RsaSsaPkcs1PrivateKey privKey); @Override KeyFactory<RsaSsaPkcs1KeyFormat, RsaSsaPkcs1PrivateKey> keyFactory(); static void registerPair(boolean newKeyAllowed); static final KeyTemplate rsa3072SsaPkcs1Sha256F4Template(); static final KeyTemplate rawRsa3072SsaPkcs1Sha256F4Template(); static final KeyTemplate rsa4096SsaPkcs1Sha512F4Template(); static final KeyTemplate rawRsa4096SsaPkcs1Sha512F4Template();  }
@Test public void testRawRsa4096SsaPkcs1Sha512F4Template() throws Exception { KeyTemplate template = RsaSsaPkcs1SignKeyManager.rawRsa4096SsaPkcs1Sha512F4Template(); assertThat(template.getTypeUrl()).isEqualTo(new RsaSsaPkcs1SignKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.RAW); RsaSsaPkcs1KeyFormat format = RsaSsaPkcs1KeyFormat.parseFrom( template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.hasParams()).isTrue(); assertThat(format.getParams().getHashType()).isEqualTo(HashType.SHA512); assertThat(format.getModulusSizeInBits()).isEqualTo(4096); assertThat(new BigInteger(1, format.getPublicExponent().toByteArray())) .isEqualTo(BigInteger.valueOf(65537)); }