Differences From Artifact [021fb1b137]:
- File
src/OFASN1Value.m
— part of check-in
[c60933a59b]
at
2019-02-09 17:44:00
on branch trunk
— OFASN1*: Add designated initializer
This is in preparation for DER serialization support. (user: js, size: 2936) [annotate] [blame] [check-ins using]
To Artifact [826101f4aa]:
- File src/OFASN1Value.m — part of check-in [bceb7ed4c9] at 2019-03-08 00:35:48 on branch trunk — Use dot syntax (user: js, size: 2930) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
44 45 46 47 48 49 50 | tagNumber: (of_asn1_tag_number_t)tagNumber constructed: (bool)constructed DEREncodedContents: (OFData *)DEREncodedContents { self = [super init]; @try { | | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | tagNumber: (of_asn1_tag_number_t)tagNumber constructed: (bool)constructed DEREncodedContents: (OFData *)DEREncodedContents { self = [super init]; @try { if (DEREncodedContents.itemSize != 1) @throw [OFInvalidFormatException exception]; _tagClass = tagClass; _tagNumber = tagNumber; _constructed = constructed; _DEREncodedContents = [DEREncodedContents copy]; } @catch (id e) { |
︙ | ︙ | |||
101 102 103 104 105 106 107 | uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD(hash, _tagClass & 0xFF); OF_HASH_ADD(hash, _tagNumber & 0xFF); OF_HASH_ADD(hash, _constructed); | | | | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | uint32_t hash; OF_HASH_INIT(hash); OF_HASH_ADD(hash, _tagClass & 0xFF); OF_HASH_ADD(hash, _tagNumber & 0xFF); OF_HASH_ADD(hash, _constructed); OF_HASH_ADD_HASH(hash, _DEREncodedContents.hash); OF_HASH_FINALIZE(hash); return hash; } - (OFString *)description { return [OFString stringWithFormat: @"<OFASN1Value:\n" @"\tTag class = %x\n" @"\tTag number = %x\n" @"\tConstructed = %u\n" @"\tDER-encoded contents = %@\n" @">", _tagClass, _tagNumber, _constructed, _DEREncodedContents.description]; } @end |