summaryrefslogtreecommitdiff
path: root/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-03-29 12:33:06 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-03-29 12:33:06 +0000
commit2a66e8925f69fcd2600f9692a6b683745496b8bc (patch)
tree3fa959252239c4e2aabc18892eee088fcd1f3fec /xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
parent05aa51989b4d21b4fb5b30dd0586d38c5a58848c (diff)
INTEGRATION: CWS xmlsec10 (1.2.38); FILE MERGED
2005/03/29 09:26:40 mmi 1.2.38.1: idl review Issue number: Submitted by: Reviewed by:
Diffstat (limited to 'xmlsecurity/tools/standalone/mscsfit/encrypter.cxx')
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/encrypter.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
index d41bd27c2..32e3a02d3 100644
--- a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
@@ -235,7 +235,7 @@ int SAL_CALL main( int argc, char **argv )
"Encryptor - "
"Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ;
- xSecCtx->setSecurityEnvironment( xSecEnv ) ;
+ xSecCtx->addSecurityEnvironment( xSecEnv ) ;
//Get encrypter
Reference< XInterface > xmlencrypter =
@@ -250,10 +250,21 @@ int SAL_CALL main( int argc, char **argv )
"Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ;
//perform encryption
- xTemplate = xEncrypter->encrypt( xTemplate , xSecCtx ) ;
+ xTemplate = xEncrypter->encrypt( xTemplate , xSecEnv ) ;
OSL_ENSURE( xTemplate.is() ,
"Encryptor - "
"Cannot encrypt the xml document" ) ;
+
+
+ com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus();
+ if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED)
+ {
+ fprintf( stdout, "Operation succeeds.\n") ;
+ }
+ else
+ {
+ fprintf( stdout, "Operation fails.\n") ;
+ }
} catch( Exception& e ) {
fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
goto done ;