Code Examples – Introduction

Introduction  |  Message Digest  |  Symmetric ciphers  |  RSA  |  ECIES  |  Digital signatures (S/MIME)

Introduction: In this section, we provide some code examples demonstrating the usage of different algorithms implemented by the FlexiProvider packages. We assume that you are familiar with Java programming and basic cryptographic techniques, so only the stuff related to the usage of the FlexiProvider will be explained in detail. These explanations should enable you to integrate security methods based on the FlexiProvider into your Java applications.

For reasons of a clearer presentation, the examples do not contain any exception handling. Instead, the main() method of each example is declared to throw an Exception. Please consult the JCA/JCE documentation and the FlexiProvider API documentation for explanations of the thrown exceptions.

The described code examples can either be read online or you can download the code snippets and try them out yourself. The examples are tailored for FlexiProvider version 1.5.1p2 and CoDec version build17-jdk13. They have been tested with Java versions 1.3.1_18, 1.4.2_12, 1.5.0_10, and 1.6.0_03.

 Message Digest download code
 En-/Decryption with symmetric ciphers download code
 En-/Decryption with RSA download code
 En-/Decryption with ECIES download code
 Digital signatures (index page)
Signing a message (RSA) download code
Verification of digital signatures (RSA) download code
Signing a message (ECDSA) download code
Verification of digital signatures (ECDSA) download code

All examples use the FlexiCoreProvider. In order to use the elliptic curve examples, you will also need the FlexiECProvider. Please note that these FlexiProvider packages must be on the classpath of your building environment.

Druckerenglisch deutsche Flagge   Impressum