Botan  1.11.15
src/lib/cert/x509/key_constraint.h
Go to the documentation of this file.
00001 /*
00002 * Enumerations
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_ENUMS_H__
00009 #define BOTAN_ENUMS_H__
00010 
00011 #include <botan/ber_dec.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * X.509v3 Key Constraints.
00017 */
00018 enum Key_Constraints {
00019    NO_CONSTRAINTS     = 0,
00020    DIGITAL_SIGNATURE  = 32768,
00021    NON_REPUDIATION    = 16384,
00022    KEY_ENCIPHERMENT   = 8192,
00023    DATA_ENCIPHERMENT  = 4096,
00024    KEY_AGREEMENT      = 2048,
00025    KEY_CERT_SIGN      = 1024,
00026    CRL_SIGN           = 512,
00027    ENCIPHER_ONLY      = 256,
00028    DECIPHER_ONLY      = 128
00029 };
00030 
00031 class Public_Key;
00032 
00033 /**
00034 * Create the key constraints for a specific public key.
00035 * @param pub_key the public key from which the basic set of
00036 * constraints to be placed in the return value is derived
00037 * @param limits additional limits that will be incorporated into the
00038 * return value
00039 * @return combination of key type specific constraints and
00040 * additional limits
00041 */
00042 
00043 BOTAN_DLL Key_Constraints find_constraints(const Public_Key& pub_key,
00044                                            Key_Constraints limits);
00045 
00046 /**
00047 * BER Decoding Function for key constraints
00048 */
00049 namespace BER {
00050 
00051 void BOTAN_DLL decode(BER_Decoder&, Key_Constraints&);
00052 
00053 }
00054 
00055 }
00056 
00057 #endif