VirtualBox

source: vbox/trunk/src/libs/openssl-3.3.2/include/internal/der.h@ 108403

最後變更 在這個檔案從108403是 108206,由 vboxsync 提交於 5 週 前

openssl-3.3.2: Exported all files to OSE and removed .scm-settings ​bugref:10757

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 3.2 KB
 
1/*
2 * Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_INTERNAL_DER_H
11# define OSSL_INTERNAL_DER_H
12# pragma once
13
14# include <openssl/bn.h>
15# include "internal/packet.h"
16
17/*
18 * NOTE: X.690 numbers the identifier octet bits 1 to 8.
19 * We use the same numbering in comments here.
20 */
21
22/* Well known primitive tags */
23
24/*
25 * DER UNIVERSAL tags, occupying bits 1-5 in the DER identifier byte
26 * These are only valid for the UNIVERSAL class. With the other classes,
27 * these bits have a different meaning.
28 */
29# define DER_P_EOC 0 /* BER End Of Contents tag */
30# define DER_P_BOOLEAN 1
31# define DER_P_INTEGER 2
32# define DER_P_BIT_STRING 3
33# define DER_P_OCTET_STRING 4
34# define DER_P_NULL 5
35# define DER_P_OBJECT 6
36# define DER_P_OBJECT_DESCRIPTOR 7
37# define DER_P_EXTERNAL 8
38# define DER_P_REAL 9
39# define DER_P_ENUMERATED 10
40# define DER_P_UTF8STRING 12
41# define DER_P_SEQUENCE 16
42# define DER_P_SET 17
43# define DER_P_NUMERICSTRING 18
44# define DER_P_PRINTABLESTRING 19
45# define DER_P_T61STRING 20
46# define DER_P_VIDEOTEXSTRING 21
47# define DER_P_IA5STRING 22
48# define DER_P_UTCTIME 23
49# define DER_P_GENERALIZEDTIME 24
50# define DER_P_GRAPHICSTRING 25
51# define DER_P_ISO64STRING 26
52# define DER_P_GENERALSTRING 27
53# define DER_P_UNIVERSALSTRING 28
54# define DER_P_BMPSTRING 30
55
56/* DER Flags, occupying bit 6 in the DER identifier byte */
57# define DER_F_PRIMITIVE 0x00
58# define DER_F_CONSTRUCTED 0x20
59
60/* DER classes tags, occupying bits 7-8 in the DER identifier byte */
61# define DER_C_UNIVERSAL 0x00
62# define DER_C_APPLICATION 0x40
63# define DER_C_CONTEXT 0x80
64# define DER_C_PRIVATE 0xC0
65
66/*
67 * Run-time constructors.
68 *
69 * They all construct DER backwards, so care should be taken to use them
70 * that way.
71 */
72
73/* This can be used for all items that don't have a context */
74# define DER_NO_CONTEXT -1
75
76int ossl_DER_w_precompiled(WPACKET *pkt, int tag,
77 const unsigned char *precompiled,
78 size_t precompiled_n);
79
80int ossl_DER_w_boolean(WPACKET *pkt, int tag, int b);
81int ossl_DER_w_uint32(WPACKET *pkt, int tag, uint32_t v);
82int ossl_DER_w_bn(WPACKET *pkt, int tag, const BIGNUM *v);
83int ossl_DER_w_null(WPACKET *pkt, int tag);
84int ossl_DER_w_octet_string(WPACKET *pkt, int tag,
85 const unsigned char *data, size_t data_n);
86int ossl_DER_w_octet_string_uint32(WPACKET *pkt, int tag, uint32_t value);
87
88/*
89 * All constructors for constructed elements have a begin and a end function
90 */
91int ossl_DER_w_begin_sequence(WPACKET *pkt, int tag);
92int ossl_DER_w_end_sequence(WPACKET *pkt, int tag);
93
94#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette