javaextensions/satsa/crypto/src/stsconstants.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Internal constants.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef STSCONSTANTS_H
       
    20 #define STSCONSTANTS_H
       
    21 
       
    22 
       
    23 
       
    24 namespace java
       
    25 {
       
    26 namespace satsa
       
    27 {
       
    28 
       
    29 
       
    30 // KSTSErr<java expection name without Expection word>
       
    31 // Refer to JSR177 for correct meaning for expections.
       
    32 
       
    33 // Base value for own error code to distinguish them from native error codes.
       
    34 const int KSTSErrBase = -3000;
       
    35 
       
    36 const int KSTSErrIllegalState = KSTSErrBase - 1;
       
    37 const int KSTSErrSignature = KSTSErrBase - 2;
       
    38 const int KSTSErrBadPadding = KSTSErrBase - 3;
       
    39 const int KSTSErrIllegalBlockSize = KSTSErrBase - 4;
       
    40 const int KSTSErrNoSuchPadding = KSTSErrBase - 5;
       
    41 const int KSTSErrNoSuchAlgorithm = KSTSErrBase - 6;
       
    42 const int KSTSErrInvalidKey = KSTSErrBase - 7;
       
    43 const int KSTSErrInvalidAlgorithmParameter = KSTSErrBase - 8;
       
    44 const int KSTSErrShortBuffer = KSTSErrBase - 9;
       
    45 const int KSTSErrDigest = KSTSErrBase - 10;
       
    46 const int KSTSErrIllegalStateInput = KSTSErrBase - 11;
       
    47 
       
    48 const int KSTSErrNoMemory = -4;
       
    49 const int KSTSErrNotSupported = -5;
       
    50 const int KSTSErrArgument = -6;
       
    51 
       
    52 // **** CIPHER
       
    53 // A transformation is of the form:
       
    54 // algorithm/mode/padding
       
    55 #define STSTransformationDelim L"/"
       
    56 
       
    57 //new defines
       
    58 // **** ALGORITHM
       
    59 #define STSAlgorithmRSA L"RSA"
       
    60 #define STSAlgorithmDSA L"DSA"
       
    61 
       
    62 #define STSAlgorithmDES L"DES"
       
    63 #define STSAlgorithmAES L"AES"
       
    64 #define STSAlgorithmRC2 L"RC2"
       
    65 #define STSAlgorithm3DES L"DESEDE"
       
    66 
       
    67 // **** MODE
       
    68 #define STSModeCBC L"CBC"
       
    69 #define STSModeECB L"ECB"
       
    70 #define STSModeNONE L"NONE"
       
    71 
       
    72 // **** PADDING
       
    73 #define STSPaddingNone L"NOPADDING"
       
    74 #define STSPaddingPKCS7 L"PKCS7PADDING"
       
    75 #define STSPaddingPKCS5 L"PKCS5PADDING"
       
    76 
       
    77 // **** KEY FORMATS
       
    78 #define STSKeyFormatRAW L"RAW"
       
    79 #define STSKeyFormatX509 L"X.509"
       
    80 #define STSKeyFormatPKCS8 L"PKCS8"
       
    81 
       
    82 // **** MESSAGE DIGEST
       
    83 #define STSDigestSHA L"SHA"
       
    84 
       
    85 // The message digest algorithm as defined in NIST's FIPS 180-1.
       
    86 // The output of this algorithm is a 160-bit digest.
       
    87 #define STSDigestSHA1 L"SHA-1"
       
    88 
       
    89 // SHA-1 message digest algorithm name to be used with signatures.
       
    90 #define STSDigestSHA1Signature L"SHA1"
       
    91 
       
    92 // The message digest algorithm as defined in RFC 1319.
       
    93 // The output of this algorithm is a 128-bit (16 byte) digest.
       
    94 #define STSDigestMD2 L"MD2"
       
    95 
       
    96 // The message digest algorithm as defined in RFC 1321.
       
    97 // The output of this algorithm is a 128-bit (16 byte) digest.
       
    98 #define STSDigestMD5 L"MD5"
       
    99 
       
   100 // **** SIGNATURE
       
   101 // Signature algorithm is a form of <digest>with<encryption>
       
   102 #define STSSignatureSeparator L"WITH"
       
   103 #define STSSignatureSeparatorLength 4
       
   104 
       
   105 } // namespace satsa
       
   106 } // namespace java
       
   107 #endif // STSCONSTANTS_H
       
   108 // End of File