public abstract class MacSpi extends Object
Mac
类。在这个类中的所有的抽象方法必须实现由每个密码服务提供商,谁希望提供一个特定的一个特定的算法的实现。
实现自由实现Cloneable接口。
Constructor and Description |
---|
MacSpi() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
返回一个克隆如果实现Cloneable。
|
protected abstract byte[] |
engineDoFinal()
完成MAC计算重置为进一步使用MAC,保持MAC初始化密钥。
|
protected abstract int |
engineGetMacLength()
返回字节的字节的长度。
|
protected abstract void |
engineInit(Key key, AlgorithmParameterSpec params)
与给定的初始化MAC(秘密)的密钥和算法参数。
|
protected abstract void |
engineReset()
重置为进一步使用MAC,保持MAC初始化密钥。
|
protected abstract void |
engineUpdate(byte input)
处理给定字节。
|
protected abstract void |
engineUpdate(byte[] input, int offset, int len)
在
input 第一
len 字节的过程,从
offset 包容。
|
protected void |
engineUpdate(ByteBuffer input)
过程
input.remaining() 字节缓冲区
input ,开始在
input.position() 。
|
protected abstract int engineGetMacLength()
protected abstract void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
key
-(秘密)的关键。
params
-算法参数。
InvalidKeyException
-如果给定的关键是初始化这个MAC不合适。
InvalidAlgorithmParameterException
-如果给定的算法参数的MAC是不合适的。
protected abstract void engineUpdate(byte input)
input
-输入字节进行处理。
protected abstract void engineUpdate(byte[] input, int offset, int len)
input
第一
len
字节的过程,从
offset
包容。
input
-输入缓冲区。
offset
-
input
那里开始输入偏移。
len
-字节数的过程。
protected void engineUpdate(ByteBuffer input)
input.remaining()
字节缓冲区
input
,开始在
input.position()
。当返回时,缓冲区的位置将等于它的极限,它的限制不会改变。
子类应该考虑重写此方法,如果他们能更有效地比过程字节缓冲区的字节数组。
input
- ByteBuffer
protected abstract byte[] engineDoFinal()
protected abstract void engineReset()
public Object clone() throws CloneNotSupportedException
clone
方法重写,继承类
Object
CloneNotSupportedException
-如果这是号召,不支持
Cloneable
实施。
Cloneable
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.