]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - include/crypto/x509_acert.h
Add RFC 5755 attribute certificate support
[thirdparty/openssl.git] / include / crypto / x509_acert.h
diff --git a/include/crypto/x509_acert.h b/include/crypto/x509_acert.h
new file mode 100644 (file)
index 0000000..3223bf6
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_X509_ACERT_H
+# define OSSL_CRYPTO_X509_ACERT_H
+# pragma once
+
+# include <openssl/x509_acert.h>
+
+struct ossl_object_digest_info_st {
+    ASN1_ENUMERATED digestedObjectType;
+    ASN1_OBJECT *otherObjectTypeID;
+    X509_ALGOR digestAlgorithm;
+    ASN1_BIT_STRING objectDigest;
+};
+
+struct ossl_issuer_serial_st {
+    STACK_OF(GENERAL_NAME) *issuer;
+    ASN1_INTEGER serial;
+    ASN1_BIT_STRING *issuerUID;
+};
+
+struct X509_acert_issuer_v2form_st {
+    STACK_OF(GENERAL_NAME) *issuerName;
+    OSSL_ISSUER_SERIAL *baseCertificateId;
+    OSSL_OBJECT_DIGEST_INFO *objectDigestInfo;
+};
+
+typedef struct X509_acert_issuer_st {
+    int type;
+    union {
+        STACK_OF(GENERAL_NAME) *v1Form;
+        X509_ACERT_ISSUER_V2FORM *v2Form;
+    } u;
+} X509_ACERT_ISSUER;
+
+typedef struct X509_holder_st {
+    OSSL_ISSUER_SERIAL *baseCertificateID;
+    STACK_OF(GENERAL_NAME) *entityName;
+    OSSL_OBJECT_DIGEST_INFO *objectDigestInfo;
+} X509_HOLDER;
+
+struct X509_acert_info_st {
+    ASN1_INTEGER version;      /* default of v2 */
+    X509_HOLDER holder;
+    X509_ACERT_ISSUER issuer;
+    X509_ALGOR signature;
+    ASN1_INTEGER serialNumber;
+    X509_VAL validityPeriod;
+    STACK_OF(X509_ATTRIBUTE) *attributes;
+    ASN1_BIT_STRING *issuerUID;
+    X509_EXTENSIONS *extensions;
+};
+
+struct X509_acert_st {
+    X509_ACERT_INFO *acinfo;
+    X509_ALGOR sig_alg;
+    ASN1_BIT_STRING signature;
+};
+#endif