MYSymmetricKey.h
author snej@snej.local
Thu Apr 09 22:46:48 2009 -0700 (2009-04-09)
changeset 6 2d7692f9b6b4
parent 1 60e4cbbb5128
child 12 e4c971be4079
permissions -rw-r--r--
Updated the README for the 0.1 release.
     1 //
     2 //  MYSymmetricKey.h
     3 //  MYCrypto
     4 //
     5 //  Created by Jens Alfke on 4/2/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import "MYKey.h"
    10 #import <CommonCrypto/CommonCryptor.h>
    11 
    12 
    13 @interface MYSymmetricKey : MYKey <MYEncryption, MYDecryption>
    14 
    15 /** Initializes a symmetric key from the given key data and algorithm. */
    16 - (id) initWithKeyData: (NSData*)keyData
    17              algorithm: (CCAlgorithm)algorithm;
    18 
    19 /** Randomly generates a new symmetric key, using the given algorithm and key-size in bits.
    20     The key is not added to any keychain; if you want to keep the key persistently, use
    21     the method of the same name in the MYKeychain class. */
    22 + (MYSymmetricKey*) generateSymmetricKeyOfSize: (unsigned)keySizeInBits
    23                                      algorithm: (CCAlgorithm)algorithm;
    24 
    25 /** The key's algorithm. */
    26 @property (readonly) CCAlgorithm algorithm;
    27 
    28 /** The key's size/length, in bits. */
    29 @property (readonly) unsigned keySizeInBits;
    30 
    31 @end