|
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: Provides the functionality of a DSA based cryptographic |
|
15 * cipher for encryption and decryption. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef STSDSASIGNATURE_H |
|
21 #define STSDSASIGNATURE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <string> |
|
25 #include <openssl/dsa.h> |
|
26 #include <openssl/pem.h> |
|
27 #include <openssl/x509.h> |
|
28 #include <openssl/evp.h> |
|
29 #include <jni.h> |
|
30 #include "stssignature.h" |
|
31 |
|
32 using namespace std; |
|
33 namespace java |
|
34 { |
|
35 namespace satsa |
|
36 { |
|
37 |
|
38 |
|
39 |
|
40 /** |
|
41 * Provides RSA signature algorithm. |
|
42 */ |
|
43 class STSDSASignature: public STSSignature |
|
44 { |
|
45 public: |
|
46 // Constructors and destructor |
|
47 |
|
48 static STSDSASignature* Create(const std::wstring aPadding, int* errCode); |
|
49 |
|
50 virtual ~STSDSASignature(); |
|
51 |
|
52 public: |
|
53 // From STSSignature |
|
54 int InitVerify(JNIEnv* aJni, jstring aKeyAlgorithm, jstring aKeyFormat, |
|
55 jbyteArray aKeyEncoded); |
|
56 |
|
57 int Verify(JNIEnv* aJni, jbyteArray aSignature); |
|
58 |
|
59 int Update(JNIEnv* aJni, jbyteArray aData, jint aOffset, jint aLength); |
|
60 |
|
61 protected: |
|
62 |
|
63 |
|
64 STSDSASignature(); |
|
65 |
|
66 int Construct(const std::wstring aPadding); |
|
67 |
|
68 private: |
|
69 |
|
70 |
|
71 DSA* mDSA; |
|
72 EVP_PKEY *mpkey; |
|
73 }; |
|
74 } // namespace satsa |
|
75 } // namespace java |
|
76 #endif // STSDSASIGNATURE_H |
|
77 // End of File |