public abstract class MacSpi extends Object
Mac类。
该类中的所有抽象方法必须由希望提供特定MAC算法的实现的每个加密服务提供商来实现。
实现可以实现Cloneable接口。
| Constructor and Description |
|---|
MacSpi() |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
如果实现是可克隆的,则返回克隆。
|
protected abstract byte[] |
engineDoFinal()
完成MAC计算并重置MAC进一步使用,维护MAC初始化的秘密密钥。
|
protected abstract int |
engineGetMacLength()
以字节为单位返回MAC的长度。
|
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)
处理第一
len字节
input ,起始于
offset以下。
|
protected void |
engineUpdate(ByteBuffer input)
处理
input.remaining()字节的ByteBuffer
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)
len字节
input ,起始于
offset以下。
input - 输入缓冲区。
offset -
input中输入开始的偏移量。
len - 要处理的字节数。
protected void engineUpdate(ByteBuffer input)
input.remaining()字节的ByteBuffer input ,从input.position()开始。
返回时,缓冲区的位置将等于其限制;
其限制将不会改变。
子类应该考虑覆盖此方法,如果它们可以比字节数组更有效地处理ByteBuffers。
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.