Java 类org.apache.commons.codec.BinaryEncoder 实例源码

项目:commons-codec-proxies    文件:RareBinaryEncoderProxyTest.java   
@Test
public void testAsBinaryEncoder() throws EncoderException {

    final BinaryEncoder encoder =
        (BinaryEncoder) RareBinaryEncoderProxy.newInstance();

    try {
        encoder.encode((byte[]) null);
        Assert.fail("passed: encode((byte[]) null)");
    } catch (final NullPointerException npe) {
        // expected
    }

    final byte[] expected = new byte[0];
    final byte[] actual = encoder.encode(expected);
    Assert.assertEquals(actual, expected);
}
项目:hex-codec    文件:HexBinaryEncoderProxyTest.java   
@Test
public void testAsBinaryEncoder() throws EncoderException {

    final BinaryEncoder encoder =
        (BinaryEncoder) HexBinaryEncoderProxy.newInstance();

    try {
        encoder.encode((byte[]) null);
        Assert.fail("passed: encode((byte[]) null)");
    } catch (final NullPointerException npe) {
        // expected
    }

    final byte[] decoded = Tests.decodedBytes();
    final byte[] encoded = encoder.encode(decoded);
}
项目:appengine-tck    文件:LoggingTestBase.java   
protected static WebArchive getDefaultDeployment(TestContext context) {
    context.setAppEngineWebXmlFile("appengine-web-with-logging-properties.xml");
    WebArchive war = getTckDeployment(context);
    war.addClasses(LoggingTestBase.class, TestBase.class)
        // classes for Base64.isBase64()
        .addClasses(Base64.class, BaseNCodec.class)
        .addClasses(BinaryEncoder.class, Encoder.class)
        .addClasses(BinaryDecoder.class, Decoder.class)
        .addClasses(EncoderException.class, DecoderException.class)
        .addAsWebInfResource("currentTimeUsec.jsp")
        .addAsWebInfResource("doNothing.jsp")
        .addAsWebInfResource("storeTestData.jsp")
        .addAsWebInfResource("throwException.jsp")
        .addAsWebInfResource("log4j-test.properties")
        .addAsWebInfResource("logging-all.properties");
    return war;
}
项目:gwt-commons-codec    文件:Base64Codec13Test.java   
/**
 * Tests to make sure Base64's implementation of the org.apache.commons.codec.BinaryEncoder
 * interface is behaving identical to commons-codec-1.3.jar.
 *
 * @throws EncoderException problem
 */
@Test
public void testBinaryEncoder() throws EncoderException {
    final BinaryEncoder enc = new Base64();
    for (int i = 0; i < STRINGS.length; i++) {
        if (STRINGS[i] != null) {
            final byte[] base64 = utf8(STRINGS[i]);
            final byte[] binary = BYTES[i];
            final boolean b = Arrays.equals(base64, enc.encode(binary));
            assertTrue("BinaryEncoder test-" + i, b);
        }
    }
}
项目:nv-cipher    文件:AESCipherTest.java   
private <TCoder extends BinaryEncoder & BinaryDecoder> void doTest(String plain, String key, String iv, TCoder coder)
{
    AESCipher cipher = new AESCipher();

    if (coder != null)
    {
        cipher.setCoder(coder);
    }

    cipher.setKey(key, iv);

    // Encrypt.
    String encrypted = cipher.encrypt(plain);

    if (iv == null)
    {
        byte[] iv2 = cipher.getCipher().getIV();
        cipher.setKey(key, iv2);
    }

    // Decrypt.
    String decrypted = cipher.decrypt(encrypted);

    if (DEBUG)
    {
        System.out.println("----------");
        System.out.println("codec     = " + ((coder != null) ? coder.getClass().getSimpleName() : "default"));
        System.out.println("plain     = " + plain);
        System.out.println("encrypted = " + encrypted);
        System.out.println("decrypted = " + decrypted);
    }

    assertNotEquals(plain, encrypted);
    assertEquals(plain, decrypted);
}
项目:appengine-tck    文件:DatastoreHelperTestBase.java   
protected static WebArchive getHelperDeployment() {
    WebArchive war = getTckDeployment();
    war.addClass(DatastoreHelperTestBase.class)
        .addClasses(Base64.class, BaseNCodec.class)
        .addClasses(BinaryEncoder.class, Encoder.class)
        .addClasses(BinaryDecoder.class, Decoder.class)
        .addClasses(EncoderException.class, DecoderException.class);
    return war;
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a cipher, an encoder and a decoder.
 *
 * @param cipher
 *         A cipher. If {@code null} is given, {@link #setCipher(Cipher)}
 *         must be called later with a valid cipher.
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String)} and
 *         {@link #decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 */
public CodecCipher(Cipher cipher, BinaryEncoder encoder, BinaryDecoder decoder)
{
    this.cipher  = cipher;
    this.encoder = encoder;
    this.decoder = decoder;
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Set an encoder.
 *
 * @param encoder
 *         An encoder used by {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])}.
 *
 * @return
 *         {@code this} object.
 */
public CodecCipher setEncoder(BinaryEncoder encoder)
{
    this.encoder = encoder;

    return this;
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Set a coder.
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 *
 * @return
 *         {@code this} object.
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher setCoder(TCoder coder)
{
    this.encoder = coder;
    this.decoder = coder;

    return this;
}
项目:metron    文件:DefaultHasher.java   
/**
 * Builds a utility to hash values based on a given algorithm.
 * @param algorithm The algorithm used when hashing a value.
 * @param encoder The encoder to use to encode the hashed value.
 * @param charset The charset that will be used during hashing and encoding.
 * @see java.security.Security
 * @see java.security.MessageDigest
 */
public DefaultHasher(final String algorithm, final BinaryEncoder encoder, final Charset charset) {
  this.algorithm = algorithm;
  this.encoder = encoder;
  this.charset = charset;
}
项目:metron    文件:DefaultHasher.java   
/**
 * Builds a utility to hash values based on a given algorithm. Uses {@link StandardCharsets#UTF_8} for encoding.
 * @param algorithm The algorithm used when hashing a value.
 * @param encoder The encoder to use to encode the hashed value.
 * @see java.security.Security
 * @see java.security.MessageDigest
 */
public DefaultHasher(final String algorithm, final BinaryEncoder encoder) {
  this.algorithm = algorithm;
  this.encoder = encoder;
  this.charset = StandardCharsets.UTF_8;
}
项目:nv-cipher    文件:AESCipher.java   
/**
 * Constructor with an encoder and a decoder.
 *
 * <p>
 * This constructor just performs {@link CodecCipher#CodecCipher(String,
 * BinaryEncoder, BinaryDecoder) super("AES/CBC/PKCS5Padding", encoder, decoder)}.
 * </p>
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String) encrypt(String)} and
 *         {@link #encrypt(byte[]) encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String) decrypt(String)} and
 *         {@link #decrypt(byte[]) decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 */
public AESCipher(BinaryEncoder encoder, BinaryDecoder decoder)
{
    super(TRANSFORMATION, encoder, decoder);
}
项目:nv-cipher    文件:AESCipher.java   
/**
 * Constructor with a transformation, an encoder and a decoder.
 *
 * <p>
 * This constructor just performs {@link CodecCipher#CodecCipher(String,
 * BinaryEncoder, BinaryDecoder) super(transformation, encoder, decoder)}.
 * </p>
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String) encrypt(String)} and
 *         {@link #encrypt(byte[]) encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String) decrypt(String)} and
 *         {@link #decrypt(byte[]) decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 *
 * @since 1.3
 */
public AESCipher(String transformation, BinaryEncoder encoder, BinaryDecoder decoder)
{
    super(transformation, encoder, decoder);
}
项目:nv-cipher    文件:AESCipher.java   
/**
 * Constructor with a coder.
 *
 * <p>
 * This constructor just performs {@code super("AES/CBC/PKCS5Padding", coder)}.
 * </p>
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> AESCipher(TCoder coder)
{
    super(TRANSFORMATION, coder);
}
项目:nv-cipher    文件:AESCipher.java   
/**
 * Constructor with a transformation and a coder.
 *
 * <p>
 * This constructor just performs {@code super(transformation, coder)}.
 * </p>
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 *
 * @since 1.3
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> AESCipher(String transformation, TCoder coder)
{
    super(transformation, coder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a cipher and a coder.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(Cipher, BinaryEncoder, BinaryDecoder)
 * CodecCipher(cipher, coder, coder)}.
 * </p>
 *
 * @param cipher
 *         A cipher. If {@code null} is given, {@link #setCipher(Cipher)}
 *         must be called later with a valid cipher.
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher(Cipher cipher, TCoder coder)
{
    this(cipher, coder, coder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a cipher.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(Cipher, BinaryEncoder, BinaryDecoder)
 * CodecCipher(cipher, (BinaryEncoder)null, (BinaryDecoder)null)}.
 * </p>
 *
 * @param cipher
 *         A cipher. If {@code null} is given, {@link #setCipher(Cipher)}
 *         must be called later with a valid cipher.
 */
public CodecCipher(Cipher cipher)
{
    this(cipher, (BinaryEncoder)null, (BinaryDecoder)null);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation, an encoder and a decoder.
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String)} and
 *         {@link #decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public CodecCipher(String transformation, BinaryEncoder encoder, BinaryDecoder decoder) throws IllegalArgumentException
{
    this(getCipherInstance(transformation), encoder, decoder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation and a coder.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, coder, coder)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher(String transformation, TCoder coder) throws IllegalArgumentException
{
    this(transformation, coder, coder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, (BinaryEncoder)null, (BinaryDecoder)null)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher(String transformation) throws IllegalArgumentException
{
    this(transformation, (BinaryEncoder)null, (BinaryDecoder)null);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation, a provider, an encoder and a decoder.
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A name of provider which provides the implementation of the
 *         transformation.
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String)} and
 *         {@link #decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException}, {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException} and {@link java.security.NoSuchProviderException
 *         NoSuchProviderException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public CodecCipher(String transformation, String provider, BinaryEncoder encoder, BinaryDecoder decoder) throws IllegalArgumentException
{
    this(getCipherInstance(transformation, provider), encoder, decoder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation, a provider and a coder.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, String, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, provider, coder, coder)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A name of provider which provides the implementation of the
 *         transformation.
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException}, {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException} and {@link java.security.NoSuchProviderException
 *         NoSuchProviderException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher(String transformation, String provider, TCoder coder) throws IllegalArgumentException
{
    this(transformation, provider, coder, coder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation and a provider.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, String, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, provider, (BinaryEncoder)null, (BinaryDecoder)null)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A name of provider which provides the implementation of the
 *         transformation.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException}, {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException} and {@link java.security.NoSuchProviderException
 *         NoSuchProviderException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public CodecCipher(String transformation, String provider) throws IllegalArgumentException
{
    this(transformation, provider, (BinaryEncoder)null, (BinaryDecoder)null);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation, a provider, an encoder and a decoder.
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A provider which provides the implementation of the transformation.
 *
 * @param encoder
 *         An encoder used in {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])} to encode an encrypted byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         encoder.
 *
 * @param decoder
 *         A decoder used in {@link #decrypt(String)} and
 *         {@link #decrypt(byte[])} to decode an encoded input byte array.
 *         If {@code null} is given, {@link Base64} is used as the default
 *         decoder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public CodecCipher(String transformation, Provider provider, BinaryEncoder encoder, BinaryDecoder decoder) throws IllegalArgumentException
{
    this(getCipherInstance(transformation, provider), encoder, decoder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation, a provider and a coder.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, Provider, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, provider, coder, coder)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A provider which provides the implementation of the transformation.
 *
 * @param coder
 *         A coder which works as both an encoder and a decoder.
 *         If {@code null} is given, {@link Base64} is used as the
 *         default coder.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public <TCoder extends BinaryEncoder & BinaryDecoder> CodecCipher(String transformation, Provider provider, TCoder coder) throws IllegalArgumentException
{
    this(transformation, provider, coder, coder);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Constructor with a transformation and a provider.
 *
 * <p>
 * This constructor is an alias of {@link #CodecCipher(String, Provider, BinaryEncoder, BinaryDecoder)
 * CodecCipher(transformation, provider, (BinaryEncoder)null, (BinaryDecoder)null)}.
 * </p>
 *
 * @param transformation
 *         A transformation in the form of either <code>"<i>algorithm/mode/padding</i>"</code>
 *         or <code>"<i>algorithm</i>"</code>. For example, <code>"AES/CBC/PKCS5Padding"</code>.
 *
 * @param provider
 *         A provider which provides the implementation of the transformation.
 *
 * @throws IllegalArgumentException
 *         The given transformation is not supported. This exception wraps
 *         the original exception (such as {@link java.security.NoSuchAlgorithmException
 *         NoSuchAlgorithmException} and {@link javax.crypto.NoSuchPaddingException
 *         NoSuchPaddingException}) as the cause.
 *
 * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"
 *      >Cipher (Encryption) Algorithms</a>
 *
 * @see StandardCipherTransformations
 */
public CodecCipher(String transformation, Provider provider) throws IllegalArgumentException
{
    this(transformation, provider, (BinaryEncoder)null, (BinaryDecoder)null);
}
项目:nv-cipher    文件:CodecCipher.java   
/**
 * Get the encoder which this instance internally holds.
 *
 * @return
 *         The internal encoder. This may be {@code null}, and
 *         in such a case, {@link #encrypt(String)} and
 *         {@link #encrypt(byte[])} use {@link Base64}.
 */
public BinaryEncoder getEncoder()
{
    return encoder;
}