• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 #ifndef HCF_X509_CRL_SPI_H
17 #define HCF_X509_CRL_SPI_H
18 
19 #include "blob.h"
20 #include "object_base.h"
21 #include "pub_key.h"
22 #include "result.h"
23 #include "x509_certificate.h"
24 #include "x509_crl_entry.h"
25 
26 typedef struct HcfX509CrlSpi HcfX509CrlSpi;
27 
28 struct HcfX509CrlSpi {
29     HcfObjectBase base;
30 
31     const char *(*engineGetType)(HcfX509CrlSpi *self);
32 
33     bool (*engineIsRevoked)(HcfX509CrlSpi *self, const HcfCertificate *cert);
34 
35     HcfResult (*engineGetEncoded)(HcfX509CrlSpi *self, HcfEncodingBlob *encodedByte);
36 
37     HcfResult (*engineVerify)(HcfX509CrlSpi *self, HcfPubKey *key);
38 
39     long (*engineGetVersion)(HcfX509CrlSpi *self);
40 
41     HcfResult (*engineGetIssuerName)(HcfX509CrlSpi *self, HcfBlob *out);
42 
43     HcfResult (*engineGetLastUpdate)(HcfX509CrlSpi *self, HcfBlob *out);
44 
45     HcfResult (*engineGetNextUpdate)(HcfX509CrlSpi *self, HcfBlob *out);
46 
47     HcfResult (*engineGetRevokedCert)(HcfX509CrlSpi *self, long serialNumber, HcfX509CrlEntry **entryOut);
48 
49     HcfResult (*engineGetRevokedCertWithCert)(HcfX509CrlSpi *self, HcfX509Certificate *cert,
50         HcfX509CrlEntry **entryOut);
51 
52     HcfResult (*engineGetRevokedCerts)(HcfX509CrlSpi *self, HcfArray *entrysOut);
53 
54     HcfResult (*engineGetTbsInfo)(HcfX509CrlSpi *self, HcfBlob *tbsCertListOut);
55 
56     HcfResult (*engineGetSignature)(HcfX509CrlSpi *self, HcfBlob *signature);
57 
58     HcfResult (*engineGetSignatureAlgName)(HcfX509CrlSpi *self, HcfBlob *out);
59 
60     HcfResult (*engineGetSignatureAlgOid)(HcfX509CrlSpi *self, HcfBlob *out);
61 
62     HcfResult (*engineGetSignatureAlgParams)(HcfX509CrlSpi *self, HcfBlob *sigAlgParamOut);
63 };
64 
65 #endif // HCF_X509_CERTIFICATE_SPI_H
66