• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package com.ohos.hapsigntool.signer;
17 
18 import java.security.cert.X509CRL;
19 import java.security.cert.X509Certificate;
20 import java.security.spec.AlgorithmParameterSpec;
21 import java.util.List;
22 
23 /**
24  * ISigner.
25  *
26  * @since 2021/12/28
27  */
28 public interface ISigner {
29     /**
30      * Sign function, implement by local or remote.
31      *
32      * @param data          Data to sign
33      * @param signAlg       Sign algorithm
34      * @param parameterSpec Preset params
35      * @return Data signed
36      */
getSignature(byte[] data, String signAlg, AlgorithmParameterSpec parameterSpec)37     byte[] getSignature(byte[] data, String signAlg, AlgorithmParameterSpec parameterSpec);
38 
39     /**
40      * getCrls.
41      *
42      * @return crls
43      */
getCrls()44     List<X509CRL> getCrls();
45 
46     /**
47      * getCertificates.
48      *
49      * @return Certificates
50      */
getCertificates()51     List<X509Certificate> getCertificates();
52 
53 }
54