EcdsaSignKeyManager extends PrivateKeyTypeManager<EcdsaPrivateKey, EcdsaPublicKey> { public static final KeyTemplate rawEcdsaP256Template() { return createKeyTemplate( HashType.SHA256, EllipticCurveType.NIST_P256, EcdsaSignatureEncoding.IEEE_P1363, KeyTemplate.OutputPrefixType.RAW); } EcdsaSignKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override EcdsaPublicKey getPublicKey(EcdsaPrivateKey key); @Override KeyMaterialType keyMaterialType(); @Override EcdsaPrivateKey parseKey(ByteString byteString); @Override void validateKey(EcdsaPrivateKey privKey); @Override KeyFactory<EcdsaKeyFormat, EcdsaPrivateKey> keyFactory(); static void registerPair(boolean newKeyAllowed); static final KeyTemplate ecdsaP256Template(); static final KeyTemplate rawEcdsaP256Template(); static KeyTemplate createKeyTemplate(
      HashType hashType,
      EllipticCurveType curve,
      EcdsaSignatureEncoding encoding,
      KeyTemplate.OutputPrefixType prefixType);  }
@Test public void testRawEcdsaP256Template() throws Exception { KeyTemplate template = EcdsaSignKeyManager.rawEcdsaP256Template(); assertThat(template.getTypeUrl()).isEqualTo(new EcdsaSignKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.RAW); EcdsaKeyFormat format = EcdsaKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.hasParams()).isTrue(); assertThat(format.getParams().getHashType()).isEqualTo(HashType.SHA256); assertThat(format.getParams().getCurve()).isEqualTo(EllipticCurveType.NIST_P256); assertThat(format.getParams().getEncoding()).isEqualTo(EcdsaSignatureEncoding.IEEE_P1363); }