test/jdk/com/sun/jarsigner/DefaultMethod.java
author dholmes
Wed, 06 Nov 2019 21:18:42 -0500
changeset 58956 9a0a5e70eeb2
parent 47216 71c04702a3d5
permissions -rw-r--r--
8233454: Test fails with assert(!is_init_completed(), "should only happen during init") after JDK-8229516 Reviewed-by: jiefu, dcubed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24033
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     1
/*
38556
868af536ce12 8157633: Fix module dependencies for /com/* tests
jjiang
parents: 24033
diff changeset
     2
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
24033
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     4
 *
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     8
 *
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    13
 * accompanied this code).
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    14
 *
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    18
 *
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    21
 * questions.
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    22
 */
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    23
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    24
/*
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    25
 * @test
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    26
 * @bug 8039358
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    27
 * @summary com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be default
38556
868af536ce12 8157633: Fix module dependencies for /com/* tests
jjiang
parents: 24033
diff changeset
    28
 * @modules jdk.jartool
24033
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    29
 * @compile DefaultMethod.java
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    30
 */
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    31
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    32
import com.sun.jarsigner.ContentSignerParameters;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    33
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    34
import java.net.URI;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    35
import java.security.cert.X509Certificate;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    36
import java.util.zip.ZipFile;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    37
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    38
public class DefaultMethod implements ContentSignerParameters {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    39
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    40
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    41
    public String[] getCommandLine() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    42
        return new String[0];
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    43
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    44
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    45
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    46
    public URI getTimestampingAuthority() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    47
        return null;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    48
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    49
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    50
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    51
    public X509Certificate getTimestampingAuthorityCertificate() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    52
        return null;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    53
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    54
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    55
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    56
    public byte[] getSignature() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    57
        return new byte[0];
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    58
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    59
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    60
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    61
    public String getSignatureAlgorithm() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    62
        return null;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    63
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    64
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    65
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    66
    public X509Certificate[] getSignerCertificateChain() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    67
        return new X509Certificate[0];
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    68
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    69
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    70
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    71
    public byte[] getContent() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    72
        return new byte[0];
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    73
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    74
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    75
    @Override
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    76
    public ZipFile getSource() {
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    77
        return null;
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    78
    }
fed71c27dd2a 8039358: com.sun.jarsigner.ContentSignerParameters.getTSAPolicyID() should be a default method
weijun
parents:
diff changeset
    79
}