Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

@param value NSString of UTF8 string
*/
- (void)appendUTF8String:(NSString *)value;
- (void)appendUTF8StringASN1:(NSString *)value;



Expand All @@ -67,6 +67,6 @@

@param data NSData of Bit string
*/
- (void)appendBITString:(NSData *)data;
- (void)appendBITStringASN1:(NSData *)data;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ - (void)appendSubjectItem:(uint8_t[])attribute size:(int)size value:(NSString *)
{
NSMutableData *subjectItem = [[NSMutableData alloc] initWithCapacity:128];
[subjectItem appendBytes:attribute length:size];
[subjectItem appendUTF8String:value];
[subjectItem appendUTF8StringASN1:value];
[subjectItem encloseWith:0x30]; // Sequence tag
[subjectItem encloseWith:0x31]; // Set tag

Expand Down Expand Up @@ -68,14 +68,14 @@ + (NSData *)buildPublicKeyForASN1:(NSData *)publicKeyBits
[publicKeyASN encloseWith:0x30]; // Sequence tag
[publicKeyASN prependByte:0x00];

[publicKeyData appendBITString:publicKeyASN];
[publicKeyData appendBITStringASN1:publicKeyASN];
[publicKeyData encloseWith:0x30]; // Sequence tag

return publicKeyData;
}


- (void)appendUTF8String:(NSString *)value
- (void)appendUTF8StringASN1:(NSString *)value
{
//
// UTF8STRING type
Expand All @@ -87,7 +87,7 @@ - (void)appendUTF8String:(NSString *)value
}


- (void)appendBITString:(NSData *)data
- (void)appendBITStringASN1:(NSData *)data
{
//
// BIT string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ - (NSString *)generateCSRWithUsername:(NSString *)userName publicKeyBits:(NSData
uint8_t zero = 0;
[signdata appendBytes:&zero length:1];
[signdata appendBytes:signature length:signature_len];
[certificateSigningRequest appendBITString:signdata];
[certificateSigningRequest appendBITStringASN1:signdata];

[certificateSigningRequest encloseWith:0x30];

Expand Down