JDK Tutorials - Herong's Tutorial Examples - Version 6.02, by Dr. Herong Yang
DSA Public Key Encryption Tests
This section provides the test result of DSA public key encryption and private key decryption using the javax.crypto.Cipher class.
Here is the result of my first test of JcePublicCipher.java with the DSA algorithm. It was done with JDK 1.8.
>java JcePublicCipher DSA encrypt dsa.pub JcePublicCipher.java jce.cph KeyFactory Object Info: Algorithm = DSA Provider = SUN version 1.8 toString = java.security.KeyFactory@42e816 Key Object Info: Algorithm = DSA Saved File = dsa.pub Length = 244 Format = X.509 toString = Sun DSA Public Key Parameters:DSA p: fca682ce 8e12caba 26efccf7 110e526d b078b05e decbcd1e b4a208f3 ae1617ae 01f35b91 a47e6df6 3413c5e1 2ed0899b cd132acd 50d99151 bdc43ee7 37592e17 q: 962eddcc 369cba8e bb260ee6 b6a126d9 346e38c5 g: 678471b2 7a9cf44e e91a49c5 147db1a9 aaf244f0 5a434d64 86931d2d 14271b9e 35030b71 fd73da17 9069b32e 2935630e 1c206235 4d0da20a 6c416e50 be794ca4 y: e82a134e b1f8f5ae b40c2709 ccfb9da6 314ef48c ec025a37 0b7ed86d d35647e2 d3fb17f2 c0ed1bdf dce6ea96 de04a2f6 8d87666e ed6a1123 588c289a 9ad741ed Exception: java.security.NoSuchAlgorithmException: Cannot find any provider supporting DSA
This tells us that there is no implementation of DSA public key encryption in JDK 1.8.
Last update: 2014.
Table of Contents
Downloading and Installing JDK 1.8.0 on Windows
Downloading and Installing JDK 1.7.0 on Windows
Downloading and Installing JDK 1.6.2 on Windows
Date, Time and Calendar Classes
Date and Time Object and String Conversion
Number Object and Numeric String Conversion
Locales, Localization Methods and Resource Bundles
Calling and Importing Classes Defined in Unnamed Packages
HashSet, Vector, HashMap and Collection Classes
Character Set Encoding Classes and Methods
Encoding Conversion Programs for Encoded Text Files
Datagram Network Communication
DOM (Document Object Model) - API for XML Files
DTD (Document Type Definition) - XML Validation
XSD (XML Schema Definition) - XML Validation
XSL (Extensible Stylesheet Language)
Message Digest Algorithm Implementations in JDK
Private key and Public Key Pair Generation
PKCS#8/X.509 Private/Public Encoding Standards
Digital Signature Algorithm and Sample Program
"keytool" Commands and "keystore" Files
KeyStore and Certificate Classes
Secret Key Generation and Management
►Cipher - Secret Key Encryption and Decryption
javax.crypto.Cipher - The Secret Key Encryption Class
JceSecretCipher.java - Secret Key Encryption Sample Program
Blowfish and DES Secret Key Encryption Tests
JcePublicCipher.java - Private and Public Key Encryption
►DSA Public Key Encryption Tests
RSA Public Key Encryption Tests
The SSL (Secure Socket Layer) Protocol
SSL Socket Communication Testing Programs