AusweisApp
 
Lade ...
Suche ...
Keine Treffer
CVCertificate.h
gehe zur Dokumentation dieser Datei
1
4
5#pragma once
6
7#include "CVCertificateBody.h"
8
9#include <QByteArrayList>
10#include <QDateTime>
11#include <QDebug>
12#include <QList>
13#include <QSharedPointer>
14
15
16class test_StatePreVerification;
17
18
19namespace governikus
20{
21
35
36
38 : public ASN1_OCTET_STRING
39{
40 // we use inheritance, because the structure ValidityDate is already a typedef of ASN1_OCTET_STRING
41 // and we cannot have two template specializations for the same type.
42};
43
44
45using CVCertificate = struct cvcertificate_st
46{
47 friend class ::test_StatePreVerification;
48
49 CVCertificateBody* mBody;
50 SIGNATURE* mSignature;
51
52 static QList<QSharedPointer<const cvcertificate_st>> fromRaw(const QByteArrayList& pByteList);
53 static QSharedPointer<const cvcertificate_st> fromRaw(const QByteArray& pBytes);
54 [[nodiscard]] QByteArray encode() const;
55
56 [[nodiscard]] const CVCertificateBody& getBody() const;
57 [[nodiscard]] QByteArray getRawBody() const;
58 [[nodiscard]] QByteArray getSignature() const;
59 [[nodiscard]] QByteArray getRawSignature() const;
60
61 [[nodiscard]] bool isValidOn(const QDateTime& pValidationDate) const;
62 [[nodiscard]] bool isIssuedBy(const cvcertificate_st& pIssuer) const;
63};
64
65
66DECLARE_ASN1_FUNCTIONS(CVCertificate)
68
69
70inline bool operator==(const CVCertificate& pLeft, const CVCertificate& pRight)
71{
72 return pLeft.getRawBody() == pRight.getRawBody() && pLeft.getRawSignature() == pRight.getRawSignature();
73}
74
75
76inline bool operator!=(const CVCertificate& pLeft, const CVCertificate& pRight)
77{
78 return !(pLeft == pRight);
79}
80
81
82} // namespace governikus
83
84QDebug operator<<(QDebug pDbg, const governikus::CVCertificate& pCvc);
85QDebug operator<<(QDebug pDbg, const QSharedPointer<const governikus::CVCertificate>& pCvc);
86QDebug operator<<(QDebug pDbg, const QSharedPointer<governikus::CVCertificate>& pCvc);
87QDebug operator<<(QDebug pDbg, const QList<QSharedPointer<governikus::CVCertificate>>& pCvcs);
#define DECLARE_ASN1_OBJECT(name)
Definition ASN1TemplateUtil.h:175
QDebug operator<<(QDebug pDbg, const governikus::CVCertificate &pCvc)
Definition CVCertificate.cpp:113
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17
struct cvcertificate_st { friend class ::test_StatePreVerification; CVCertificateBody *mBody; SIGNATURE *mSignature; static QList< QSharedPointer< const cvcertificate_st > > fromRaw(const QByteArrayList &pByteList); static QSharedPointer< const cvcertificate_st > fromRaw(const QByteArray &pBytes);[[nodiscard]] QByteArray encode() const ;[[nodiscard]] const CVCertificateBody &getBody() const ;[[nodiscard]] QByteArray getRawBody() const ;[[nodiscard]] QByteArray getSignature() const ;[[nodiscard]] QByteArray getRawSignature() const ;[[nodiscard]] bool isValidOn(const QDateTime &pValidationDate) const ;[[nodiscard]] bool isIssuedBy(const cvcertificate_st &pIssuer) const ;} CVCertificate
Definition CVCertificate.h:45
struct certificateprofilebody_st { ASN1_OCTET_STRING *mCertificateProfileIdentifier; ASN1_STRING *mCertificationAuthorityReference; EcdsaPublicKey *mPublicKey; ASN1_STRING *mCertificateHolderReference; CHAT *mChat; ASN1_OCTET_STRING *mEffectiveDate; ASN1_OCTET_STRING *mExpirationDate; STACK_OF(ASN1_TYPE) *mExtensions; static QSharedPointer< certificateprofilebody_st > decode(const QByteArray &pBytes); QByteArray encode();[[nodiscard]] QByteArray getCertificateProfileIdentifier() const ;[[nodiscard]] QByteArray getCertificationAuthorityReference() const ;[[nodiscard]] const EcdsaPublicKey &getPublicKey() const ;[[nodiscard]] QByteArray getCertificateHolderReference() const ;[[nodiscard]] const CHAT &getCHAT() const ; void setCertificateExpirationDate(QDate date);[[nodiscard]] QDate getCertificateExpirationDate() const ; void setCertificateEffectiveDate(QDate date);[[nodiscard]] QDate getCertificateEffectiveDate() const ;[[nodiscard]] QCryptographicHash::Algorithm getHashAlgorithm() const ;[[nodiscard]] QByteArray getExtension(const Oid &pOid) const ;} CVCertificateBody
Definition CVCertificateBody.h:24
bool operator!=(const CVCertificate &pLeft, const CVCertificate &pRight)
Definition CVCertificate.h:76
According to.
Definition CVCertificate.h:39