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.api; 17 18 import com.ohos.hapsigntool.entity.Options; 19 20 /** 21 * Public api of core lib to deal with signature. 22 * 23 * @since 2021/12/28 24 */ 25 public interface ServiceApi { 26 /** 27 * Generate keystore. 28 * 29 * @param options options 30 * @return Result indicating whether the keystore is generated. 31 */ generateKeyStore(Options options)32 boolean generateKeyStore(Options options); 33 34 /** 35 * Generate csr. 36 * 37 * @param options options 38 * @return Result indicating whether the csr is generated. 39 */ generateCsr(Options options)40 boolean generateCsr(Options options); 41 42 /** 43 * Generate cert. 44 * 45 * @param options options 46 * @return Result indicating whether the cert is generated. 47 */ generateCert(Options options)48 boolean generateCert(Options options); 49 50 /** 51 * Generate CA. 52 * 53 * @param options options 54 * @return Result indicating whether the CA is generated. 55 */ generateCA(Options options)56 boolean generateCA(Options options); 57 58 /** 59 * Generate app cert. 60 * 61 * @param options options 62 * @return Result indicating whether the app cert is generated. 63 */ generateAppCert(Options options)64 boolean generateAppCert(Options options); 65 66 /** 67 * Generate profile cert. 68 * 69 * @param options options 70 * @return Result indicating whether the profile cert is generated. 71 */ generateProfileCert(Options options)72 boolean generateProfileCert(Options options); 73 74 /** 75 * Sign for profile. 76 * 77 * @param options options 78 * @return Result indicating whether the profile is signed. 79 */ signProfile(Options options)80 boolean signProfile(Options options); 81 82 /** 83 * Verify profile. 84 * 85 * @param options options 86 * @return Result indicating whether the profile is correct. 87 */ verifyProfile(Options options)88 boolean verifyProfile(Options options); 89 90 /** 91 * Sign for hap. 92 * 93 * @param options options 94 * @return Result indicating whether the HAP is signed. 95 */ signHap(Options options)96 boolean signHap(Options options); 97 98 /** 99 * Verify hap. 100 * 101 * @param options options 102 * @return Result indicating whether the HAP is correct. 103 */ verifyHap(Options options)104 boolean verifyHap(Options options); 105 106 } 107