MYCryptoTest.m
changeset 4 f4709533c816
parent 3 1dfe820d7ebe
child 5 b2e360b78189
     1.1 --- a/MYCryptoTest.m	Wed Apr 08 16:30:52 2009 -0700
     1.2 +++ b/MYCryptoTest.m	Thu Apr 09 21:36:21 2009 -0700
     1.3 @@ -10,6 +10,7 @@
     1.4  #import "MYPrivateKey.h"
     1.5  #import "MYKeychain.h"
     1.6  #import "MYDigest.h"
     1.7 +#import "MYIdentity.h"
     1.8  #import "MYCrypto_Private.h"
     1.9  
    1.10  
    1.11 @@ -71,6 +72,19 @@
    1.12      }
    1.13  }
    1.14  
    1.15 +TestCase(EnumerateIdentities) {
    1.16 +    RequireTestCase(MYKeychain);
    1.17 +    NSEnumerator *e = [[MYKeychain allKeychains] enumerateIdentities];
    1.18 +    Log(@"Enumerator = %@", e);
    1.19 +    CAssert(e);
    1.20 +    for (MYIdentity *ident in e) {
    1.21 +        Log(@"Found %@ -- name=%@, emails=(%@), key=%@",
    1.22 +            ident, ident.commonName, 
    1.23 +            [ident.emailAddresses componentsJoinedByString: @", "],
    1.24 +            ident.privateKey);
    1.25 +    }
    1.26 +}
    1.27 +
    1.28  
    1.29  #pragma mark -
    1.30  #pragma mark SYMMETRIC KEYS: