Factored out the name accessors of MYParsedCertificate into a new class MYCertificateName, so that both subject and issuer can be accessed. A bit of other cleanup too.
5 // Created by Jens Alfke on 4/10/09.
6 // Copyright 2009 Jens Alfke. All rights reserved.
9 #import "MYCrypto+Cocoa.h"
10 #import "MYCrypto_Private.h"
11 #import "MYIdentity.h"
14 @implementation SFChooseIdentityPanel (MYCrypto)
17 - (NSInteger)my_runModalForIdentities:(NSArray *)identities
18 message:(NSString *)message
20 NSMutableArray *identityRefs = $marray();
21 for (MYIdentity *ident in identities)
22 [identityRefs addObject: (id)ident.identityRef];
23 return [self runModalForIdentities: identityRefs message: message];
26 - (void)my_beginSheetForWindow:(NSWindow *)docWindow
27 modalDelegate:(id)delegate
28 didEndSelector:(SEL)didEndSelector
29 contextInfo:(void *)contextInfo
30 identities:(NSArray *)identities
31 message:(NSString *)message
33 NSMutableArray *identityRefs = $marray();
34 for (MYIdentity *ident in identities)
35 [identityRefs addObject: (id)ident.identityRef];
36 [self beginSheetForWindow:docWindow
37 modalDelegate:delegate
38 didEndSelector:didEndSelector
39 contextInfo:contextInfo
40 identities:identityRefs
44 - (MYIdentity*) my_identity {
45 return [MYIdentity identityWithIdentityRef: [self identity]];
53 Copyright (c) 2009, Jens Alfke <jens@mooseyard.com>. All rights reserved.
55 Redistribution and use in source and binary forms, with or without modification, are permitted
56 provided that the following conditions are met:
58 * Redistributions of source code must retain the above copyright notice, this list of conditions
59 and the following disclaimer.
60 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
61 and the following disclaimer in the documentation and/or other materials provided with the
64 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
65 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
66 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRI-
67 BUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
69 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
70 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
71 THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.