Differences From Artifact [84eafb2ba8]:
- File src/OFData+ASN1DERValue.m — part of check-in [cfed9215e4] at 2018-10-14 22:41:52 on branch trunk — Add ASN.1 Object Identifier type (user: js, size: 6113) [annotate] [blame] [check-ins using]
To Artifact [c2a6a4af74]:
- File
src/OFData+ASN1DERValue.m
— part of check-in
[b1944fd052]
at
2018-10-27 13:01:38
on branch trunk
— Do not subclass OFASN1Value
The reason for this is that OFASN1Value requires an initializer for DER
encoding, however, it might be beneficial to create an ASN.1 type
without providing DER encoding for it. (user: js, size: 6301) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | #import "OFData+ASN1DERValue.h" #import "OFASN1BitString.h" #import "OFASN1Boolean.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" #import "OFASN1Integer.h" | < > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #import "OFData+ASN1DERValue.h" #import "OFASN1BitString.h" #import "OFASN1Boolean.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" #import "OFASN1Integer.h" #import "OFASN1NumericString.h" #import "OFASN1ObjectIdentifier.h" #import "OFASN1OctetString.h" #import "OFASN1PrintableString.h" #import "OFASN1UTF8String.h" #import "OFASN1Value.h" #import "OFArray.h" #import "OFNull.h" #import "OFSet.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" |
︙ | ︙ | |||
170 171 172 173 174 175 176 | case OF_ASN1_TAG_NUMBER_BIT_STRING: valueClass = [OFASN1BitString class]; break; case OF_ASN1_TAG_NUMBER_OCTET_STRING: valueClass = [OFASN1OctetString class]; break; case OF_ASN1_TAG_NUMBER_NULL: | > > | > > | > > | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | case OF_ASN1_TAG_NUMBER_BIT_STRING: valueClass = [OFASN1BitString class]; break; case OF_ASN1_TAG_NUMBER_OCTET_STRING: valueClass = [OFASN1OctetString class]; break; case OF_ASN1_TAG_NUMBER_NULL: if (tag & ASN1_TAG_CONSTRUCTED_MASK) @throw [OFInvalidFormatException exception]; if ([contents count] != 0) @throw [OFInvalidFormatException exception]; *object = [OFNull null]; return bytesConsumed; case OF_ASN1_TAG_NUMBER_OBJECT_IDENTIFIER: valueClass = [OFASN1ObjectIdentifier class]; break; case OF_ASN1_TAG_NUMBER_ENUMERATED: valueClass = [OFASN1Enumerated class]; break; case OF_ASN1_TAG_NUMBER_UTF8_STRING: |
︙ | ︙ | |||
207 208 209 210 211 212 213 | valueClass = [OFASN1IA5String class]; break; default: valueClass = [OFASN1Value class]; break; } | > | | | | | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | valueClass = [OFASN1IA5String class]; break; default: valueClass = [OFASN1Value class]; break; } *object = [[[valueClass alloc] initWithTagClass: tag >> 6 tagNumber: tag & 0x1F constructed: tag & ASN1_TAG_CONSTRUCTED_MASK DEREncodedContents: contents] autorelease]; return bytesConsumed; } @implementation OFData (ASN1DERValue) - (id)ASN1DERValue { return [self ASN1DERValueWithDepthLimit: 32]; |
︙ | ︙ |