182efe392Sopenharmony_ci/* 282efe392Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 382efe392Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 482efe392Sopenharmony_ci * you may not use this file except in compliance with the License. 582efe392Sopenharmony_ci * You may obtain a copy of the License at 682efe392Sopenharmony_ci * 782efe392Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 882efe392Sopenharmony_ci * 982efe392Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1082efe392Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1182efe392Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1282efe392Sopenharmony_ci * See the License for the specific language governing permissions and 1382efe392Sopenharmony_ci * limitations under the License. 1482efe392Sopenharmony_ci */ 1582efe392Sopenharmony_ci 1682efe392Sopenharmony_ci#ifndef CF_CERTIFICATE_H 1782efe392Sopenharmony_ci#define CF_CERTIFICATE_H 1882efe392Sopenharmony_ci 1982efe392Sopenharmony_ci#include "cf_blob.h" 2082efe392Sopenharmony_ci#include "cf_object_base.h" 2182efe392Sopenharmony_ci#include "cf_result.h" 2282efe392Sopenharmony_ci 2382efe392Sopenharmony_citypedef struct HcfCertificate HcfCertificate; 2482efe392Sopenharmony_ci 2582efe392Sopenharmony_cistruct HcfCertificate { 2682efe392Sopenharmony_ci struct CfObjectBase base; 2782efe392Sopenharmony_ci 2882efe392Sopenharmony_ci /** Verify that this certificate corresponding to the specified public key. */ 2982efe392Sopenharmony_ci CfResult (*verify)(HcfCertificate *self, void *key); 3082efe392Sopenharmony_ci 3182efe392Sopenharmony_ci /** Get the serialized cert data.*/ 3282efe392Sopenharmony_ci CfResult (*getEncoded)(HcfCertificate *self, CfEncodingBlob *encodedByte); 3382efe392Sopenharmony_ci 3482efe392Sopenharmony_ci /** Get the public key from this certificate. */ 3582efe392Sopenharmony_ci CfResult (*getPublicKey)(HcfCertificate *self, void **keyOut); 3682efe392Sopenharmony_ci}; 3782efe392Sopenharmony_ci 3882efe392Sopenharmony_ci#endif // CF_CERTIFICATE_H 39