Implement -description for X509Certificate
This commit is contained in:
parent
3b0fbe7868
commit
165ee6acca
2 changed files with 26 additions and 1 deletions
|
@ -90,6 +90,18 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
{
|
||||
OFMutableString *ret = nil;//[OFMutableString string];
|
||||
|
||||
[ret appendFormat: @"Issuer: %@\n\n", [self issuer]];
|
||||
[ret appendFormat: @"Subject: %@\n\n", [self subject]];
|
||||
[ret appendFormat: @"SANs: %@", [self subjectAlternativeName]];
|
||||
|
||||
[ret makeImmutable];
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (OFDictionary*)issuer
|
||||
{
|
||||
if (issuer == nil) {
|
||||
|
@ -383,7 +395,7 @@
|
|||
[self resizeMemory: buf
|
||||
toSize: buf_len];
|
||||
}
|
||||
ret = [OFString stringWithUTF8String: buf];
|
||||
ret = [X509OID stringWithUTF8String: buf];
|
||||
[self freeMemory: buf];
|
||||
return ret;
|
||||
}
|
||||
|
@ -399,3 +411,12 @@
|
|||
return ret;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation X509OID
|
||||
- (OFString*)description
|
||||
{
|
||||
char tmp[1024];
|
||||
OBJ_obj2txt(tmp, sizeof(tmp), OBJ_txt2obj(s->cString, 1), 0);
|
||||
return [OFString stringWithUTF8String: tmp];
|
||||
}
|
||||
@end
|
||||
|
|
Reference in a new issue