Package net.rim.device.api.crypto

Examples of net.rim.device.api.crypto.RSAPrivateKey


            final SmartCardID smartCardID = getSmartCardID();

            final RSACryptoToken token = new MyRSACryptoToken();
            final RSACryptoSystem cryptoSystem =
                    new RSACryptoSystem(token, 1024);
            RSAPrivateKey privateKey;

            final CryptoSmartCardKeyStoreData[] keyStoreDataArray =
                    new CryptoSmartCardKeyStoreData[3];

            // For this sample we use a hard coded certificate contained below.
            // This encoding would be extracted from the card using a series of
            // APDU commands.
            Certificate certificate = null;
            try {
                certificate = new X509Certificate(CERTIFICATE_ENCODING);
            } catch (final CertificateParsingException e) {
                // Should not happen.
            }

            stepProgressDialog(1);

            privateKey =
                    new RSAPrivateKey(cryptoSystem, new MyCryptoTokenData(
                            smartCardID, ID_PKI));
            keyStoreDataArray[0] =
                    new CryptoSmartCardKeyStoreData(null, ID_CERT, privateKey,
                            null, KeyStore.SECURITY_LEVEL_HIGH, certificate,
                            null, null, 0);

            stepProgressDialog(1);

            privateKey =
                    new RSAPrivateKey(cryptoSystem, new MyCryptoTokenData(
                            smartCardID, SIGNING_PKI));
            keyStoreDataArray[1] =
                    new CryptoSmartCardKeyStoreData(null, SIGNING_CERT,
                            privateKey, null, KeyStore.SECURITY_LEVEL_HIGH,
                            certificate, null, null, 0);

            stepProgressDialog(1);

            privateKey =
                    new RSAPrivateKey(cryptoSystem, new MyCryptoTokenData(
                            smartCardID, ENCRYPTION_PKI));
            keyStoreDataArray[2] =
                    new CryptoSmartCardKeyStoreData(null, ENCRYPTION_CERT,
                            privateKey, null, KeyStore.SECURITY_LEVEL_HIGH,
                            certificate, null, null, 0);
View Full Code Here

TOP

Related Classes of net.rim.device.api.crypto.RSAPrivateKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.