summaryrefslogtreecommitdiff
path: root/xmlsecurity/tools/standalone/csfit/certmngr.cxx
diff options
context:
space:
mode:
authorMichael Mi <mmi@openoffice.org>2004-07-23 07:46:47 +0000
committerMichael Mi <mmi@openoffice.org>2004-07-23 07:46:47 +0000
commit4f4e9ada797f248a8e84ffffef743fe316073358 (patch)
tree2d4d087c59cf53c17ce0d811d36778e5169c496e /xmlsecurity/tools/standalone/csfit/certmngr.cxx
parent4bcf58803bc7c10254da90cd44ad89eccbf8bd16 (diff)
Issue number:
Submitted by: Andrew Fan Reviewed by:
Diffstat (limited to 'xmlsecurity/tools/standalone/csfit/certmngr.cxx')
-rw-r--r--xmlsecurity/tools/standalone/csfit/certmngr.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/xmlsecurity/tools/standalone/csfit/certmngr.cxx b/xmlsecurity/tools/standalone/csfit/certmngr.cxx
index d4623c9c9c96..5232b71a4a8d 100644
--- a/xmlsecurity/tools/standalone/csfit/certmngr.cxx
+++ b/xmlsecurity/tools/standalone/csfit/certmngr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: certmngr.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mmi $ $Date: 2004-07-19 11:37:11 $
+ * last change: $Author: mmi $ $Date: 2004-07-23 08:46:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -101,7 +101,7 @@ extern OUString bigIntegerToNumericString( Sequence< sal_Int8 > serial ) ;
int SAL_CALL main( int argc, char **argv )
{
CERTCertDBHandle* certHandle ;
- PK11SlotInfo* slot = NULL ;
+ PK11SlotInfo* slot ;
if( argc != 3 ) {
fprintf( stderr, "Usage: %s < CertDir > <rdb file>\n\n" , argv[0] ) ;
@@ -109,6 +109,7 @@ int SAL_CALL main( int argc, char **argv )
}
for( ; getchar() != 'q' ; ) {
+ slot = NULL ;
//Initialize NSPR and NSS
PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ;
@@ -121,6 +122,15 @@ int SAL_CALL main( int argc, char **argv )
certHandle = CERT_GetDefaultCertDB() ;
slot = PK11_GetInternalKeySlot() ;
+ if( PK11_NeedLogin( slot ) ) {
+ SECStatus nRet = PK11_Authenticate( slot, PR_TRUE, NULL );
+ if( nRet != SECSuccess ) {
+ fprintf( stderr , "### cannot authehticate the crypto token!\n" ) ;
+ goto done ;
+ }
+ }
+
+
try {
Reference< XMultiComponentFactory > xManager = NULL ;
Reference< XComponentContext > xContext = NULL ;