VirtualBox

source: vbox/trunk/include/iprt/crypto/tsp.h@ 98279

Last change on this file since 98279 was 98103, checked in by vboxsync, 21 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1/** @file
2 * IPRT - Crypto - Time-Stamp Protocol (RFC-3161).
3 */
4
5/*
6 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef IPRT_INCLUDED_crypto_tsp_h
37#define IPRT_INCLUDED_crypto_tsp_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/asn1.h>
43#include <iprt/crypto/x509.h>
44
45
46RT_C_DECLS_BEGIN
47
48/** @defgroup grp_rt_cr_tap RTCrTap - Time-Stamp Protocol (RFC-3161)
49 * @ingroup grp_rt_crypto
50 * @{
51 */
52
53
54/**
55 * RFC-3161 MessageImprint (IPRT representation).
56 */
57typedef struct RTCRTSPMESSAGEIMPRINT
58{
59 /** Sequence core. */
60 RTASN1SEQUENCECORE SeqCore;
61 /** The digest algorithm used to produce HashedMessage. */
62 RTCRX509ALGORITHMIDENTIFIER HashAlgorithm;
63 /** The digest of the message being timestamped. */
64 RTASN1OCTETSTRING HashedMessage;
65} RTCRTSPMESSAGEIMPRINT;
66/** Pointer to the IPRT representation of a RFC-3161 MessageImprint. */
67typedef RTCRTSPMESSAGEIMPRINT *PRTCRTSPMESSAGEIMPRINT;
68/** Pointer to the const IPRT representation of a RFC-3161 MessageImprint. */
69typedef RTCRTSPMESSAGEIMPRINT const *PCRTCRTSPMESSAGEIMPRINT;
70RTASN1TYPE_STANDARD_PROTOTYPES(RTCRTSPMESSAGEIMPRINT, RTDECL, RTCrTspMessageImprint, SeqCore.Asn1Core);
71
72
73/**
74 * RFC-3161 Accuracy (IPRT representation).
75 */
76typedef struct RTCRTSPACCURACY
77{
78 /** Sequence core. */
79 RTASN1SEQUENCECORE SeqCore;
80 /** The seconds accuracy.
81 * This will be larger than 0. If 1 inspect the Millis field. */
82 RTASN1INTEGER Seconds;
83 /** The millisecond accuracy, optional, implicit tag 0.
84 * Range 1..999. If 1 inspect the Micros field. */
85 RTASN1INTEGER Millis;
86 /** The microsecond accuracy, optional, implicit tag 1.
87 * Range 1..999. */
88 RTASN1INTEGER Micros;
89} RTCRTSPACCURACY;
90/** Pointer to the IPRT representation of a RFC-3161 Accuracy. */
91typedef RTCRTSPACCURACY *PRTCRTSPACCURACY;
92/** Pointer to the const IPRT representation of a RFC-3161 Accuracy. */
93typedef RTCRTSPACCURACY const *PCRTCRTSPACCURACY;
94RTASN1TYPE_STANDARD_PROTOTYPES(RTCRTSPACCURACY, RTDECL, RTCrTspAccuracy, SeqCore.Asn1Core);
95
96
97/**
98 * RFC-3161 TSTInfo (IPRT representation).
99 */
100typedef struct RTCRTSPTSTINFO
101{
102 /** Sequence core. */
103 RTASN1SEQUENCECORE SeqCore;
104 /** The structure version number, current only 1 is valid. */
105 RTASN1INTEGER Version;
106 /** Time authority policy. */
107 RTASN1OBJID Policy;
108 /** The message imprint. */
109 RTCRTSPMESSAGEIMPRINT MessageImprint;
110 /** Timestamp request serial number. */
111 RTASN1INTEGER SerialNumber;
112 /** The timestamp. */
113 RTASN1TIME GenTime;
114 /** The timestamp accuracy, optional. */
115 RTCRTSPACCURACY Accuracy;
116 /** Ordering, whatever that means, defaults to FALSE. */
117 RTASN1BOOLEAN Ordering;
118 /** Nonce, optional. */
119 RTASN1INTEGER Nonce;
120 /** Timestamp authority name, explicit optional.
121 * (Should match a name in the certificate of the signature.) */
122 struct
123 {
124 /** Context tag 0. */
125 RTASN1CONTEXTTAG0 CtxTag0;
126 /** The TSA name. */
127 RTCRX509GENERALNAME Tsa;
128 } T0;
129 /** Extensions, optional, implicit tag 1. */
130 RTCRX509EXTENSION Extensions;
131} RTCRTSPTSTINFO;
132/** Pointer to the IPRT representation of a RFC-3161 TSTInfo. */
133typedef RTCRTSPTSTINFO *PRTCRTSPTSTINFO;
134/** Pointer to the const IPRT representation of a RFC-3161 TSTInfo. */
135typedef RTCRTSPTSTINFO const *PCRTCRTSPTSTINFO;
136RTASN1TYPE_STANDARD_PROTOTYPES(RTCRTSPTSTINFO, RTDECL, RTCrTspTstInfo, SeqCore.Asn1Core);
137
138/** The object identifier for RTCRTSPTSTINFO.
139 * Found in the ContentType field of PKCS \#7's ContentInfo structure and
140 * the equivalent CMS field. */
141#define RTCRTSPTSTINFO_OID "1.2.840.113549.1.9.16.1.4"
142
143/** @} */
144
145RT_C_DECLS_END
146
147#endif /* !IPRT_INCLUDED_crypto_tsp_h */
148
Note: See TracBrowser for help on using the repository browser.

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