Path: blob/master/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
41154 views
/*1* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.jarsigner;2627import java.net.URI;28import java.security.cert.X509Certificate;29import java.util.zip.ZipFile;3031/**32* This interface encapsulates the parameters for a ContentSigner object.33*34* @since 1.535* @author Vincent Ryan36* @deprecated This class has been deprecated.37*/38@Deprecated(since="9", forRemoval=true)39public interface ContentSignerParameters {4041/**42* Retrieves the command-line arguments passed to the jarsigner tool.43*44* @return The command-line arguments. May be null.45*/46public String[] getCommandLine();4748/**49* Retrieves the identifier for a Timestamping Authority (TSA).50*51* @return The TSA identifier. May be null.52*/53public URI getTimestampingAuthority();5455/**56* Retrieves the certificate for a Timestamping Authority (TSA).57*58* @return The TSA certificate. May be null.59*/60public X509Certificate getTimestampingAuthorityCertificate();6162/**63* Retrieves the TSAPolicyID for a Timestamping Authority (TSA).64*65* @return The TSAPolicyID. May be null.66*/67public default String getTSAPolicyID() {68return null;69}7071/**72* Retreives the message digest algorithm that is used to generate73* the message imprint to be sent to the TSA server.74*75* @since 976* @return The non-null string of the message digest algorithm name.77*/78public default String getTSADigestAlg() {79return "SHA-256";80}8182/**83* Retrieves the JAR file's signature.84*85* @return The non-null array of signature bytes.86*/87public byte[] getSignature();8889/**90* Retrieves the name of the signature algorithm.91*92* @return The non-null string name of the signature algorithm.93*/94public String getSignatureAlgorithm();9596/**97* Retrieves the signer's X.509 certificate chain.98*99* @return The non-null array of X.509 public-key certificates.100*/101public X509Certificate[] getSignerCertificateChain();102103/**104* Retrieves the content that was signed.105* The content is the JAR file's signature file.106*107* @return The content bytes. May be null.108*/109public byte[] getContent();110111/**112* Retrieves the original source ZIP file before it was signed.113*114* @return The original ZIP file. May be null.115*/116public ZipFile getSource();117}118119120