ObjFW
OFASN1Value.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
22 @class OFData;
23 
27 typedef enum {
37 
41 typedef enum {
69 
73 OF_SUBCLASSING_RESTRICTED
74 @interface OFASN1Value: OFObject
75 {
76  of_asn1_tag_class_t _tagClass;
77  of_asn1_tag_number_t _tagNumber;
78  bool _constructed;
79  OFData *_DEREncodedContents;
80 }
81 
85 @property (readonly, nonatomic) of_asn1_tag_class_t tagClass;
86 
90 @property (readonly, nonatomic) of_asn1_tag_number_t tagNumber;
91 
95 @property (readonly, nonatomic, getter=isConstructed) bool constructed;
96 
100 @property (readonly, nonatomic) OFData *DEREncodedContents;
101 
111 + (instancetype)valueWithTagClass: (of_asn1_tag_class_t)tagClass
112  tagNumber: (of_asn1_tag_number_t)tagNumber
113  constructed: (bool)constructed
114  DEREncodedContents: (OFData *)DEREncodedContents;
115 
116 - (instancetype)init OF_UNAVAILABLE;
117 
128 - (instancetype)initWithTagClass: (of_asn1_tag_class_t)tagClass
129  tagNumber: (of_asn1_tag_number_t)tagNumber
130  constructed: (bool)constructed
131  DEREncodedContents: (OFData *)DEREncodedContents
132  OF_DESIGNATED_INITIALIZER;
133 @end
134 
135 OF_ASSUME_NONNULL_END
of_asn1_tag_class_t
ASN.1 tag class.
Definition: OFASN1Value.h:27
@ OF_ASN1_TAG_CLASS_APPLICATION
Definition: OFASN1Value.h:31
@ OF_ASN1_TAG_CLASS_UNIVERSAL
Definition: OFASN1Value.h:29
@ OF_ASN1_TAG_CLASS_PRIVATE
Definition: OFASN1Value.h:35
@ OF_ASN1_TAG_CLASS_CONTEXT_SPECIFIC
Definition: OFASN1Value.h:33
of_asn1_tag_number_t
ASN.1 tag number.
Definition: OFASN1Value.h:41
@ OF_ASN1_TAG_NUMBER_OCTET_STRING
Definition: OFASN1Value.h:49
@ OF_ASN1_TAG_NUMBER_INTEGER
Definition: OFASN1Value.h:45
@ OF_ASN1_TAG_NUMBER_NULL
Definition: OFASN1Value.h:51
@ OF_ASN1_TAG_NUMBER_PRINTABLE_STRING
Definition: OFASN1Value.h:65
@ OF_ASN1_TAG_NUMBER_BIT_STRING
Definition: OFASN1Value.h:47
@ OF_ASN1_TAG_NUMBER_SET
Definition: OFASN1Value.h:61
@ OF_ASN1_TAG_NUMBER_ENUMERATED
Definition: OFASN1Value.h:55
@ OF_ASN1_TAG_NUMBER_BOOLEAN
Definition: OFASN1Value.h:43
@ OF_ASN1_TAG_NUMBER_UTF8_STRING
Definition: OFASN1Value.h:57
@ OF_ASN1_TAG_NUMBER_OBJECT_IDENTIFIER
Definition: OFASN1Value.h:53
@ OF_ASN1_TAG_NUMBER_IA5_STRING
Definition: OFASN1Value.h:67
@ OF_ASN1_TAG_NUMBER_NUMERIC_STRING
Definition: OFASN1Value.h:63
@ OF_ASN1_TAG_NUMBER_SEQUENCE
Definition: OFASN1Value.h:59
A class representing an ASN.1 value.
Definition: OFASN1Value.h:75
A class for storing arbitrary data in an array.
Definition: OFData.h:40
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520