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.entity; 17 18 /** 19 * Content digest algorithm 20 * 21 * @since 2021-12-13 22 */ 23 public enum ContentDigestAlgorithm { 24 SHA256("SHA-256", 256 / 8), 25 SHA384("SHA-384", 384 / 8), 26 SHA512("SHA-512", 512 / 8); 27 28 private String digestAlgorithm; 29 30 private int digestOutputByteSize; 31 ContentDigestAlgorithm(String digestAlgorithm, int digestOutputByteSize)32 ContentDigestAlgorithm(String digestAlgorithm, int digestOutputByteSize) { 33 this.digestAlgorithm = digestAlgorithm; 34 this.digestOutputByteSize = digestOutputByteSize; 35 } 36 getDigestAlgorithm()37 public String getDigestAlgorithm() { 38 return digestAlgorithm; 39 } 40 getDigestOutputByteSize()41 public int getDigestOutputByteSize() { 42 return digestOutputByteSize; 43 } 44 } 45