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_SPI_H 17 #define CF_X509_CRL_SPI_H 18 19 #include "cf_blob.h" 20 #include "cf_object_base.h" 21 #include "cf_result.h" 22 #include "pub_key.h" 23 #include "x509_certificate.h" 24 #include "x509_crl_entry.h" 25 #include "x509_crl_match_parameters.h" 26 27 typedef struct HcfX509CrlSpi HcfX509CrlSpi; 28 29 struct HcfX509CrlSpi { 30 CfObjectBase base; 31 32 const char *(*engineGetType)(HcfX509CrlSpi *self); 33 34 bool (*engineIsRevoked)(HcfX509CrlSpi *self, const HcfCertificate *cert); 35 36 CfResult (*engineGetEncoded)(HcfX509CrlSpi *self, CfEncodingBlob *encodedByte); 37 38 CfResult (*engineVerify)(HcfX509CrlSpi *self, HcfPubKey *key); 39 40 long (*engineGetVersion)(HcfX509CrlSpi *self); 41 42 CfResult (*engineGetIssuerName)(HcfX509CrlSpi *self, CfBlob *out); 43 44 CfResult (*engineGetLastUpdate)(HcfX509CrlSpi *self, CfBlob *out); 45 46 CfResult (*engineGetNextUpdate)(HcfX509CrlSpi *self, CfBlob *out); 47 48 CfResult (*engineGetRevokedCert)(HcfX509CrlSpi *self, const CfBlob *serialNumber, HcfX509CrlEntry **entryOut); 49 50 CfResult (*engineGetRevokedCertWithCert)(HcfX509CrlSpi *self, HcfX509Certificate *cert, 51 HcfX509CrlEntry **entryOut); 52 53 CfResult (*engineGetRevokedCerts)(HcfX509CrlSpi *self, CfArray *entrysOut); 54 55 CfResult (*engineGetTbsInfo)(HcfX509CrlSpi *self, CfBlob *tbsCertListOut); 56 57 CfResult (*engineGetSignature)(HcfX509CrlSpi *self, CfBlob *signature); 58 59 CfResult (*engineGetSignatureAlgName)(HcfX509CrlSpi *self, CfBlob *out); 60 61 CfResult (*engineGetSignatureAlgOid)(HcfX509CrlSpi *self, CfBlob *out); 62 63 CfResult (*engineGetSignatureAlgParams)(HcfX509CrlSpi *self, CfBlob *sigAlgParamOut); 64 65 CfResult (*engineGetExtensions)(HcfX509CrlSpi *self, CfBlob *out); 66 67 CfResult (*engineMatch)(HcfX509CrlSpi *self, const HcfX509CrlMatchParams *matchParams, bool *out); 68 }; 69 70 #endif // CF_X509_CRL_SPI_H 71