MYPrivateKey.m
changeset 9 aa5eb3fd6ebf
parent 5 b2e360b78189
child 13 6fd9177eb6da
     1.1 --- a/MYPrivateKey.m	Thu Apr 09 22:27:51 2009 -0700
     1.2 +++ b/MYPrivateKey.m	Sun Apr 12 22:16:14 2009 -0700
     1.3 @@ -155,9 +155,9 @@
     1.4                             0LL,
     1.5                             CSSM_KEYUSE_ENCRYPT | CSSM_KEYUSE_VERIFY,        // public key
     1.6                             CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_PERMANENT,
     1.7 -                           CSSM_KEYUSE_DECRYPT | CSSM_KEYUSE_SIGN,          // private key
     1.8 -                           CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_SENSITIVE | CSSM_KEYATTR_PERMANENT,
     1.9 -                           NULL, // SecAccessRef
    1.10 +                           CSSM_KEYUSE_ANY,                                 // private key
    1.11 +                           CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_PERMANENT | CSSM_KEYATTR_SENSITIVE,
    1.12 +                           NULL,                                            // SecAccessRef
    1.13                             &pubKey, &privKey);
    1.14  #endif
    1.15      if (!check(err, @"SecKeyCreatePair")) {
    1.16 @@ -172,7 +172,10 @@
    1.17  
    1.18  
    1.19  - (NSString*) description {
    1.20 -    return $sprintf(@"%@[%@]", [self class], self.publicKeyDigest.abbreviatedHexString);
    1.21 +    return $sprintf(@"%@[%@ %@ /%p]", [self class], 
    1.22 +                    self.publicKeyDigest.abbreviatedHexString,
    1.23 +                    (self.name ?:@""),
    1.24 +                    self.keychainItemRef);
    1.25  }
    1.26  
    1.27  @synthesize publicKey=_publicKey;