当前位置: 首页>>代码示例>>Java>>正文


Java NullCipherSpi类代码示例

本文整理汇总了Java中org.apache.harmony.crypto.internal.NullCipherSpi的典型用法代码示例。如果您正苦于以下问题:Java NullCipherSpi类的具体用法?Java NullCipherSpi怎么用?Java NullCipherSpi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NullCipherSpi类属于org.apache.harmony.crypto.internal包,在下文中一共展示了NullCipherSpi类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NullCipher

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
/**
 * Creates a new {@code NullCipher} instance.
 */
public NullCipher() {
    super(new NullCipherSpi(), null, null);
    try {
        this.init(Cipher.ENCRYPT_MODE, (Key)null, (SecureRandom)null);
    } catch (InvalidKeyException e) {
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:11,代码来源:NullCipher.java

示例2: NullCipher

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
/**
 * Creates a new {@code NullCipher} instance.
 */
public NullCipher() {
    super(new NullCipherSpi(), null, null);
    try {
        this.init(Cipher.ENCRYPT_MODE, (Key)null, (SecureRandom)null);    
    } catch (InvalidKeyException e) {        
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:NullCipher.java

示例3: testEngineUpdatebyteArrayintint

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineUpdatebyteArrayintint() {
	NullCipherSpi spi = new NullCipherSpi();
	byte[] b = {1,2,3,4,5,6,7,8,9};
	byte[] b1 =  spi.engineUpdate(b, 3, 4);
	for (int i = 0; i < 4; i++) {
           assertEquals("incorrect update result", b[3+i], b1[i]);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:NullCipherSpiTest.java

示例4: testEngineUpdatebyteArrayintintbyteArrayint

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineUpdatebyteArrayintintbyteArrayint() throws Exception {
	NullCipherSpi spi = new NullCipherSpi();
	byte[] b = {1,2,3,4,5,6,7,8,9};
	byte[] b1 =  new byte[10];
	assertEquals("incorrect update result", 4, spi.engineUpdate(b, 3, 4, b1, 5));
	for (int i = 0; i < 4; i++) {
           assertEquals("incorrect update result", b[3+i], b1[5+i]);
	}	
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:NullCipherSpiTest.java

示例5: testEngineDoFinalbyteArrayintint

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineDoFinalbyteArrayintint() throws Exception {
	NullCipherSpi spi = new NullCipherSpi();
	byte[] b = {1,2,3,4,5,6,7,8,9};
	byte[] b1 = null; 
	b1 = spi.engineDoFinal(b, 3, 4);
	for (int i = 0; i < 4; i++) {
           assertEquals("incorrect doFinal result", b[3+i], b1[i]);
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:NullCipherSpiTest.java

示例6: testEngineDoFinalbyteArrayintintbyteArrayint

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineDoFinalbyteArrayintintbyteArrayint() throws Exception {
	NullCipherSpi spi = new NullCipherSpi();
	byte[] b = {1,2,3,4,5,6,7,8,9};
	byte[] b1 =  new byte[10];
       assertEquals("incorrect doFinal result", 4, spi.engineDoFinal(b, 3, 4, b1, 5));
	for (int i = 0; i < 4; i++) {
           assertEquals("incorrect doFinal result", b[3+i], b1[5+i]);
	}
	
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:NullCipherSpiTest.java

示例7: testEngineWrapKey

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineWrapKey() throws Exception {
NullCipherSpi spi = new NullCipherSpi();
try {
	spi.engineWrap(null);
	fail("No expected UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
}	
  }
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:NullCipherSpiTest.java

示例8: testEngineUnwrapbyteArrayStringint

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineUnwrapbyteArrayStringint() throws Exception {
	NullCipherSpi spi = new NullCipherSpi();
	try {
		spi.engineUnwrap(new byte[3], "", 10);
		fail("No expected UnsupportedOperationException");
	} catch (UnsupportedOperationException e) {
	} 
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:NullCipherSpiTest.java

示例9: testEngineGetKeySize

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineGetKeySize() throws Exception {
	NullCipherSpi spi = new NullCipherSpi();
	try {
		spi.engineGetKeySize(null);
		fail("No expected UnsupportedOperationException");
	} catch (UnsupportedOperationException e) {
	} 
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:NullCipherSpiTest.java

示例10: Cipher

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
/**
 * @com.intel.drl.spec_ref
 *  
 */
protected Cipher(CipherSpi cipherSpi, Provider provider,
        String transformation) {
    if (cipherSpi == null) {
        throw new NullPointerException();
    }
    if (!(cipherSpi instanceof NullCipherSpi) && provider == null) {
        throw new NullPointerException();
    }
    this.provider = provider;
    this.transformation = transformation;
    this.spiImpl = cipherSpi;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:Cipher.java

示例11: NullCipher

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
/**
 * @com.intel.drl.spec_ref
 * 
 */
public NullCipher() {
    super(new NullCipherSpi(), null, null);
    try {
        this.init(Cipher.ENCRYPT_MODE, (Key)null, (SecureRandom)null);    
    } catch (InvalidKeyException e) {        
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:NullCipher.java

示例12: testEngineGetBlockSize

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineGetBlockSize() {
	NullCipherSpi spi = new NullCipherSpi();
       assertEquals("incorrect block size", 1, spi.engineGetBlockSize());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:NullCipherSpiTest.java

示例13: testEngineGetOutputSize

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineGetOutputSize() {
	NullCipherSpi spi = new NullCipherSpi();
       assertEquals("incorrect output size", 100, spi.engineGetOutputSize(100));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:NullCipherSpiTest.java

示例14: testEngineGetIV

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineGetIV() {
	NullCipherSpi spi = new NullCipherSpi();
       assertTrue("Incorrect IV", Arrays.equals(spi.engineGetIV() , new byte[8]));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:NullCipherSpiTest.java

示例15: Cipher

import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
/**
 * Creates a new Cipher instance.
 *
 * @param cipherSpi
 *            the implementation delegate of the cipher.
 * @param provider
 *            the provider of the implementation of this cipher.
 * @param transformation
 *            the name of the transformation that this cipher performs.
 * @throws NullPointerException
 *             if either cipherSpi is {@code null} or provider is {@code
 *             null} and {@code cipherSpi} is a {@code NullCipherSpi}.
 */
protected Cipher(CipherSpi cipherSpi, Provider provider,
        String transformation) {
    if (cipherSpi == null) {
        throw new NullPointerException();
    }
    if (!(cipherSpi instanceof NullCipherSpi) && provider == null) {
        throw new NullPointerException();
    }
    this.provider = provider;
    this.transformation = transformation;
    this.spiImpl = cipherSpi;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:26,代码来源:Cipher.java


注:本文中的org.apache.harmony.crypto.internal.NullCipherSpi类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。