1 /* 2 * Copyright (c) 2023 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 #ifndef CF_X509_CRL_ENTRY_H 17 #define CF_X509_CRL_ENTRY_H 18 19 #include <stdbool.h> 20 #include "cf_blob.h" 21 #include "cf_object_base.h" 22 #include "cf_result.h" 23 #include "x509_distinguished_name.h" 24 #include "cf_type.h" 25 26 typedef struct HcfX509CrlEntry HcfX509CrlEntry; 27 28 struct HcfX509CrlEntry { 29 /** HcfX509CrlEntry inherit CfObjectBase. */ 30 struct CfObjectBase base; 31 32 /** Returns the ASN of this CRL entry 1 der coding form, i.e. internal sequence. */ 33 CfResult (*getEncoded)(HcfX509CrlEntry *self, CfEncodingBlob *encodedOut); 34 35 /** Get the serial number from this x509crl entry. */ 36 CfResult (*getSerialNumber)(HcfX509CrlEntry *self, CfBlob *out); 37 38 /** Gets the issuer of the x509 certificate described by this entry. */ 39 CfResult (*getCertIssuer)(HcfX509CrlEntry *self, CfBlob *encodedOut); 40 41 /** Gets the issuer utf8 of the x509 certificate described by this entry. */ 42 CfResult (*getCertIssuerEx)(HcfX509CrlEntry *self, CfEncodinigType encodingType, CfBlob *encodedOut); 43 44 /** Gets the issuer der format of the x509 certificate described by this entry. */ 45 CfResult (*getCertIssuerDer)(HcfX509CrlEntry *self, CfBlob *encodedOut); 46 47 /** Get the revocation date from x509crl entry. */ 48 CfResult (*getRevocationDate)(HcfX509CrlEntry *self, CfBlob *out); 49 50 /** Get all the extensions in x509 CRL Entry. */ 51 CfResult (*getExtensions)(HcfX509CrlEntry *self, CfBlob *out); 52 53 /** Check If exists extensions in x509 CRL Entry. */ 54 CfResult (*hasExtensions)(HcfX509CrlEntry *self, bool *out); 55 56 /** Get the string of x509 CRL Entry. */ 57 CfResult (*toString)(HcfX509CrlEntry *self, CfBlob *out); 58 59 /** Get the hashCode of x509 CRL Entry. */ 60 CfResult (*hashCode)(HcfX509CrlEntry *self, CfBlob *out); 61 62 /** Get the Entension Object of x509 CRL Entry. */ 63 CfResult (*getExtensionsObject)(HcfX509CrlEntry *self, CfBlob *out); 64 }; 65 66 #endif // CF_X509_CRL_ENTRY_H