javaextensions/satsa/crypto/src/stssignaturefactory.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:  Creates STSCipher objects according to algorithm.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef STSSIGNATUREFACTORY_H
       
    20 #define STSSIGNATUREFACTORY_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <string>
       
    24 
       
    25 #include <jni.h>
       
    26 
       
    27 using namespace std;
       
    28 
       
    29 namespace java
       
    30 {
       
    31 namespace satsa
       
    32 {
       
    33 
       
    34 
       
    35 class STSSignature;
       
    36 
       
    37 
       
    38 /**
       
    39  *  Creates STSCipher objects according to algorithm.
       
    40  *
       
    41  *  Algorithm is specified in form of <digest>with<encryption>,
       
    42  *  which is used to form a name for a signature algorithm with a particular
       
    43  *  message digest (such as MD2 or MD5) and algorithm (such as RSA or DSA),
       
    44  *
       
    45  */
       
    46 class STSSignatureFactory
       
    47 {
       
    48 public:
       
    49     /**
       
    50      * Creates new STSCipher instance.
       
    51      *
       
    52      * @param aAlgorithm <digest>with<encryption>
       
    53      * @return New STSSignature instance.
       
    54      */
       
    55     static STSSignature* CreateSignature(JNIEnv* aJni,
       
    56                                          const jstring aAlgorithm, int* errCode);
       
    57 
       
    58     /**
       
    59      * Checks if algorithm is supported with signatures.
       
    60      *
       
    61      * @param aAlgorithm Algorithm name.
       
    62      * @return true if algorithm is supported with signatures.
       
    63      */
       
    64     static jboolean
       
    65     IsSupportedAlgorithm(JNIEnv* aJni, const jstring aAlgorithm);
       
    66 
       
    67     /**
       
    68      *
       
    69      * @param aKeyAlgorithm Name of the algorithm associated with this key.
       
    70      * @param aKeyFormat The primary encoding format of the key.
       
    71      * @param aKeyEncoded The encoded key.
       
    72      */
       
    73     static jint IsValidKey(JNIEnv* aJni, const jstring aAlgorithm,
       
    74                            const jstring aKeyFormat, const jbyteArray aKeyEncoded);
       
    75 
       
    76 };
       
    77 } // namespace satsa
       
    78 } // namespace java
       
    79 #endif // STSSIGNATUREFACTORY_H
       
    80 // End of File