8318096: Introduce AsymmetricKey interface with a getParams method

Reviewed-by: darcy, mullan, ascarpino
This commit is contained in:
Weijun Wang 2023-10-26 22:43:06 +00:00
parent 4a142c3b08
commit 9123961aaa
18 changed files with 313 additions and 20 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
package java.security.interfaces;
import java.security.PrivateKey;
import java.security.spec.NamedParameterSpec;
import java.util.Optional;
/**
@ -52,4 +53,18 @@ public interface EdECPrivateKey extends EdECKey, PrivateKey {
* If the key is not available, then an empty {@code Optional}.
*/
Optional<byte[]> getBytes();
/**
* {@inheritDoc java.security.AsymmetricKey}
*
* @implSpec
* The default implementation returns {@code null}.
*
* @return {@inheritDoc java.security.AsymmetricKey}
* @since 22
*/
@Override
default NamedParameterSpec getParams() {
return null;
}
}