src/java.base/share/classes/jdk/internal/access/JavaSecuritySignatureAccess.java
author valeriep
Wed, 10 Apr 2019 02:35:18 +0000
changeset 54483 ac20c3bdc55d
permissions -rw-r--r--
8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange Summary: Add internal Signature init methods to select provider based on both key and parameter Reviewed-by: xuelei
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54483
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     1
/*
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     4
 *
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    10
 *
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    15
 * accompanied this code).
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    16
 *
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    20
 *
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    23
 * questions.
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    24
 */
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    25
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    26
package jdk.internal.access;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    27
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    28
import java.security.*;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    29
import java.security.spec.AlgorithmParameterSpec;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    30
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    31
public interface JavaSecuritySignatureAccess {
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    32
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    33
    void initVerify(Signature s, PublicKey publicKey, AlgorithmParameterSpec params)
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    34
            throws InvalidKeyException, InvalidAlgorithmParameterException;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    35
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    36
    void initVerify(Signature s, java.security.cert.Certificate certificate,
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    37
             AlgorithmParameterSpec params)
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    38
             throws InvalidKeyException, InvalidAlgorithmParameterException;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    39
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    40
    void initSign(Signature s, PrivateKey privateKey,
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    41
             AlgorithmParameterSpec params, SecureRandom random)
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    42
             throws InvalidKeyException, InvalidAlgorithmParameterException;
ac20c3bdc55d 8216039: TLS with BC and RSASSA-PSS breaks ECDHServerKeyExchange
valeriep
parents:
diff changeset
    43
}