⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abaprovider.java

📁 面向应用的智能安全代理平台和工具包是一个综合网络应用的安全共性需求而设计和实现的一个通用性的网络信息安全应用支撑平台
💻 JAVA
字号:
package au.net.aba.crypto.provider;

/*
 * $Id: ABAProvider.java,v 1.25 1999/02/11 04:32:50 leachbj Exp $
 * $Author: leachbj $
 *
 * Copyright (C) 1996-1998 Australian Business Access Pty Ltd.
 * All rights reserved.
 * 
 * Use, modification, copying and distribution of this software is subject the
 * terms and conditions of the ABA Public Licence. See the file
 * "PUBLIC_LICENCE" for additional information.
 *
 * If you have not received a copy of the Public Licence, you must destroy all
 * copies of this file immediately. 
 *
 * $Source: /aba/CVSROOT/jdk1.1/src/au.net.aba/crypto/provider/ABAProvider.java,v $
 * $Revision: 1.25 $
 * $Date: 1999/02/11 04:32:50 $
 * $State: Exp $
 */
import java.security.Provider;

/**
 * ABA Security provider.  To use this provider via the JCE requires
 * runtime registration of the provider or static registration.
 * <p>
 * To add the provider at runtime use:
 * <pre>
 * import java.security.Security;
 * import au.net.aba.crypto.provider.ABAProvider;
 *
 * Security.addProvider(new ABAProvider());
 * </pre>
 * <p>
 * To add the provider via static registration add an entry to the
 * java.security properties file (usually
 * $JAVA_HOME/lib/security/java.security).  See that file for instructions.
 * <p>
 * The following message digest algorithms are supported by this provider:
 * <ul>
 * <li>SHA-0
 * <li>SHA, (SHA-1)
 * <li>MD5
 * </ul>
 * <p>
 * The following block ciphers are supported by the ABA provider (these
 * ciphers all default to ECB mode with no padding:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *                <th>Algorithm</th>
 *                <th>Modes</th>
 *                <th>Key Lengths</th>
 *                <th>Padding</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>DES</td>
 *                <td>ECB, CBC</td>
 *                <td>64 bit</td>
 *                <td>PKCS5Padding, NoPadding</td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>DESede</td>
 *                <td>ECB, CBC</td>
 *                <td>192 bit</td>
 *                <td>PKCS5Padding, NoPadding</td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>IDEA</td>
 *                <td>ECB, CBC</td>
 *                <td>128 bit</td>
 *                <td>PKCS5Padding, NoPadding</td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>Blowfish</td>
 *                <td>ECB, CBC</td>
 *                <td>128 bit to 448 bit</td>
 *                <td>PKCS5Padding, NoPadding</td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>Twofish</td>
 *                <td>ECB, CBC</td>
 *                <td>128, 192 or 256 bits</td>
 *                <td>PKCS7Padding, NoPadding</td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *                <td>RSA</td>
 *                <td>ECB</td>
 *                <td>96 bit up</td>
 *                <td>PKCS1Padding, NoPadding</td>
 *        </tr>
 * </table>
 * <p>
 * The following stream ciphers are supported by the ABA provider:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *          <th>Algorithm</th>
 *          <th>Key Lengths</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>RC4</td>
 *          <td>40 - 1024 bit</td>
 *        </tr>
 * </table>
 * <p>
 * Key generation is currently available for all algorithms.
 * <p>
 * Key factory classes are provided for all algorithms.
 * <p>
 * The following password based ciphers are supported by the ABA provider:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *          <th>Algorithm</th>
 *          <th>Specification</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>PBEWithMD5AndDES</td>
 *          <td><a href="http://www.rsa.com/rsalabs/pubs/PKCS/html/pkcs-5.html">PKCS#5</a></td>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>PBEWithSHA1And120BitRC4</td>
 *          <td><a href="http://www.rsa.com/rsalabs/pubs/PKCS/html/pkcs-12.html">PKCS#12</a></td>
 *        </tr>
 * </table>
 * <p>
 * The following Mac algorithms are supported by the ABA provider:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *          <th>Algorithm</th>
 *          <th>Specification</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>DES-MAC</td>
 *          <td><a href="http://www.itl.nist.gov/div897/pubs/fip113.htm">FIPS PUB 113</a></td>
 *        </tr>
 * </table>
 * <p>
 * The following signature algorithms are supported by the ABA provider:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *          <th>Algorithm</th>
 *          <th>Specification</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>MD5withRSA</td>
 *          <td><a href="http://www.rsa.com/rsalabs/pubs/PKCS/html/pkcs-1.html">PKCS#1</a></td>
 *        </tr>
 * </table>
 * <p>
 * The following KeyStore types are supported by the ABA provider:
 * <table CELLSPACING=10 CELLPADDING=0 BORDER=0>
 *        <tr ALIGN="LEFT">
 *          <th>Name</th>
 *          <th>Input/Output Stream Cipher Algorithm</th>
 *        </tr>
 *        <tr ALIGN="LEFT">
 *          <td>ABA</td>
 *          <td>PBEWithSHA-1And128BitRC4</td>
 *        </tr>
 * </table>
 */
public final class ABAProvider extends Provider
{
	public final static String ident = "$Id: ABAProvider.java,v 1.25 1999/02/11 04:32:50 leachbj Exp $";

	private static String info =
"ABA Security Provider v1.1, SHA, MD5 message Digests, and Crypto algorithms.";

	/**
	 * Construct a new provider.  This should only be required when
	 * using runtime registration of the provider using the
	 * <code>Security.addProvider()</code> mechanism.
	 */
	public ABAProvider()
	{
		super("ABA", 1.1, info);

		/*
		 * MessageDigest engines
		 */
		put("MessageDigest.MD5", "au.net.aba.crypto.provider.MD5");
		put("MessageDigest.SHA-1", "au.net.aba.crypto.provider.SHA1");
		put("Alg.Alias.MessageDigest.SHA1", "SHA-1");
		put("Alg.Alias.MessageDigest.SHA", "SHA-1");
		put("MessageDigest.SHA-0", "au.net.aba.crypto.provider.SHA0");
		put("MessageDigest.CRC16", "au.net.aba.crypto.provider.CRC16");

		/*
		 * Cipher engines
		 */
		put("Cipher.RSA", "au.net.aba.crypto.provider.RSA");
		put("Alg.Alias.Cipher.OID.1.2.840.113549.1.1.1", "RSA");
		put("Cipher.RC4", "au.net.aba.crypto.provider.RC4");
		put("Cipher.DES", "au.net.aba.crypto.provider.DES");
		put("Cipher.DESede", "au.net.aba.crypto.provider.DESede");
		put("Cipher.IDEA", "au.net.aba.crypto.provider.IDEA");
		put("Cipher.Blowfish", "au.net.aba.crypto.provider.Blowfish");
		put("Cipher.Twofish", "au.net.aba.crypto.provider.Twofish");
		put("Cipher.PBEWithMD5AndDES",
			"au.net.aba.crypto.provider.PBEWithMD5AndDES");
		put("Cipher.PBEWithSHA1And128BitRC4",
			"au.net.aba.crypto.provider.PBEWithSHA1And128BitRC4");

		/*
		 * Mac engines
		 */
		put("Mac.DESMac",
			"au.net.aba.crypto.provider.DESMac");
		put("Alg.Alias.Mac.DES-MAC", "DESMac");

		/*
		 * KeyPairGenerator engines
		 */
		put("KeyPairGenerator.RSA",
			"au.net.aba.crypto.provider.RSAKeyPairGenerator");
		put("Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1.1", "RSA");
		put("Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1.1", "RSA");

		/*
		 * KeyGenerator engines
		 */
		put("KeyGenerator.RC4",
			"au.net.aba.crypto.provider.RC4KeyGenerator");
		put("KeyGenerator.DES",
			"au.net.aba.crypto.provider.DESKeyGenerator");
		put("KeyGenerator.DESede",
			"au.net.aba.crypto.provider.DESedeKeyGenerator");
		put("KeyGenerator.IDEA",
			"au.net.aba.crypto.provider.IDEAKeyGenerator");
		put("KeyGenerator.Blowfish",
			"au.net.aba.crypto.provider.BlowfishKeyGenerator");
		put("KeyGenerator.Twofish",
			"au.net.aba.crypto.provider.TwofishKeyGenerator");

		/*
		 * Key factories
		 */
		put("KeyFactory.RSA",
			"au.net.aba.crypto.provider.RSAKeyFactory");
		put("Alg.Alias.KeyFactory.1.2.840.113549.1.1.1", "RSA");

		put("SecretKeyFactory.DES",
			"au.net.aba.crypto.provider.DESKeyFactory");
		put("SecretKeyFactory.DESede",
			"au.net.aba.crypto.provider.DESedeKeyFactory");
		put("SecretKeyFactory.RC4",
			"au.net.aba.crypto.provider.RC4KeyFactory");
		put("SecretKeyFactory.IDEA",
			"au.net.aba.crypto.provider.IDEAKeyFactory");
		put("SecretKeyFactory.Blowfish",
			"au.net.aba.crypto.provider.BlowfishKeyFactory");
		put("SecretKeyFactory.Twofish",
			"au.net.aba.crypto.provider.TwofishKeyFactory");
		put("SecretKeyFactory.PBEWithMD5AndDES",
			"au.net.aba.crypto.provider.PBEKeyFactory");
		put("SecretKeyFactory.PBEWithSHA1And128BitRC4",
			"au.net.aba.crypto.provider.PBEKeyFactory");

		/*
		 * KeyStore
		 */
		put("KeyStore.ABA", "au.net.aba.crypto.provider.KeyStore");

		/*
		 * Signature Engines
		 */
		put("Signature.MD5withRSA",
			"au.net.aba.crypto.provider.MD5withRSA");
		put("Alg.Alias.Signature.MD5/RSA", "MD5withRSA");
		put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.4", "MD5withRSA");
		put("Alg.Alias.Signature.1.2.840.113549.1.1.4", "MD5withRSA");
		put("Alg.Alias.Signature.1.3.14.3.2.25", "MD5withRSA");

		/*
		 * Certificates
		 */
		put("CertificateFactory.X509", "au.net.aba.cert.ABAX509CertFactory");
		put("Alg.Alias.CertificateFactory.X.509", "X509");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -