39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
[self release];
@throw e;
}
return self;
}
- (instancetype)initWithTagClass: (of_asn1_tag_class_t)tagClass
tagNumber: (of_asn1_tag_number_t)tagNumber
constructed: (bool)constructed
DEREncodedContents: (OFData *)DEREncodedContents
{
void *pool = objc_autoreleasePoolPush();
OFString *IA5String;
@try {
if (tagClass != OF_ASN1_TAG_CLASS_UNIVERSAL ||
tagNumber != OF_ASN1_TAG_NUMBER_IA5_STRING || constructed)
@throw [OFInvalidArgumentException exception];
if (DEREncodedContents.itemSize != 1)
@throw [OFInvalidArgumentException exception];
IA5String= [OFString
stringWithCString: DEREncodedContents.items
encoding: OF_STRING_ENCODING_ASCII
length: DEREncodedContents.count];
} @catch (id e) {
[self release];
@throw e;
}
self = [self initWithString: IA5String];
|
|
|
|
|
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
[self release];
@throw e;
}
return self;
}
- (instancetype)initWithTagClass: (OFASN1TagClass)tagClass
tagNumber: (OFASN1TagNumber)tagNumber
constructed: (bool)constructed
DEREncodedContents: (OFData *)DEREncodedContents
{
void *pool = objc_autoreleasePoolPush();
OFString *IA5String;
@try {
if (tagClass != OFASN1TagClassUniversal ||
tagNumber != OFASN1TagNumberIA5String || constructed)
@throw [OFInvalidArgumentException exception];
if (DEREncodedContents.itemSize != 1)
@throw [OFInvalidArgumentException exception];
IA5String= [OFString
stringWithCString: DEREncodedContents.items
encoding: OFStringEncodingASCII
length: DEREncodedContents.count];
} @catch (id e) {
[self release];
@throw e;
}
self = [self initWithString: IA5String];
|