Top Description Fields Constructors Methods
org.apache.sshd.common.mac

public Class BaseMac

extends Object
implements Mac
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.mac.Mac, org.apache.sshd.common.mac.MacInformation, org.apache.sshd.common.AlgorithmNameProvider
Imports
javax.crypto.spec.SecretKeySpec, org.apache.sshd.common.util.security.SecurityUtils

Base class for Mac implementations based on the JCE provider.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final String
private final int
private final int
private final boolean
private Mac
private String
s

private final byte[]

Constructor Summary

AccessConstructor and Description
public
BaseMac(String algorithm, int bsize, int defbsize, boolean etmMode)

Method Summary

Modifier and TypeMethod and Description
public void
doFinal(byte[] buf, int offset)

Implements org.apache.sshd.common.mac.Mac.doFinal.

public String
public int
public int
public void
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
update(byte[] buf, int offset, int len)

Implements org.apache.sshd.common.mac.Mac.update.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

algorithmback to summary
private final String algorithm
bsizeback to summary
private final int bsize
defbsizeback to summary
private final int defbsize
etmModeback to summary
private final boolean etmMode
macback to summary
private Mac mac
sback to summary
private String s
tmpback to summary
private final byte[] tmp

Constructor Detail

BaseMacback to summary
public BaseMac(String algorithm, int bsize, int defbsize, boolean etmMode)

Method Detail

doFinalback to summary
public void doFinal(byte[] buf, int offset) throws Exception

Implements org.apache.sshd.common.mac.Mac.doFinal.

Annotations
@Override
getAlgorithmback to summary
public String getAlgorithm()

Implements org.apache.sshd.common.AlgorithmNameProvider.getAlgorithm.

Annotations
@Override
getBlockSizeback to summary
public int getBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getBlockSize.

MAC output block size in bytes - may be less than the default - e.g., MD5-96

Annotations
@Override
getDefaultBlockSizeback to summary
public int getDefaultBlockSize()

Implements org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

Returns:int

Doc from org.apache.sshd.common.mac.MacInformation.getDefaultBlockSize.

The "natural" MAC block size in bytes

Annotations
@Override
initback to summary
public void init(byte[] key) throws Exception

Implements org.apache.sshd.common.mac.Mac.init.

Annotations
@Override
isEncryptThenMacback to summary
public boolean isEncryptThenMac()

Overrides default org.apache.sshd.common.mac.MacInformation.isEncryptThenMac.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
updateback to summary
public void update(byte[] buf, int offset, int len)

Implements org.apache.sshd.common.mac.Mac.update.

Annotations
@Override
updateUIntback to summary
public void updateUInt(long i)

Implements org.apache.sshd.common.mac.Mac.updateUInt.

Annotations
@Override