本文整理汇总了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) {
}
}
示例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) {
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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]);
}
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}
示例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;
}
示例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) {
}
}
示例12: testEngineGetBlockSize
import org.apache.harmony.crypto.internal.NullCipherSpi; //导入依赖的package包/类
public void testEngineGetBlockSize() {
NullCipherSpi spi = new NullCipherSpi();
assertEquals("incorrect block size", 1, spi.engineGetBlockSize());
}
示例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));
}
示例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]));
}
示例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;
}