Top Fields Constructors Methods
org.bouncycastle.jcajce.provider.digest

public Class BCMessageDigest

extends MessageDigest
Class Inheritance
Known Direct Subclasses
org.bouncycastle.jcajce.provider.digest.Blake2b.Blake2b512, org.bouncycastle.jcajce.provider.digest.Blake2b.Blake2b384, org.bouncycastle.jcajce.provider.digest.Blake2b.Blake2b256, org.bouncycastle.jcajce.provider.digest.Blake2b.Blake2b160, org.bouncycastle.jcajce.provider.digest.Blake2s.Blake2s256, org.bouncycastle.jcajce.provider.digest.Blake2s.Blake2s224, org.bouncycastle.jcajce.provider.digest.Blake2s.Blake2s160, org.bouncycastle.jcajce.provider.digest.Blake2s.Blake2s128, org.bouncycastle.jcajce.provider.digest.Blake3.Blake3_256, org.bouncycastle.jcajce.provider.digest.DSTU7564.DigestDSTU7564, org.bouncycastle.jcajce.provider.digest.GOST3411.Digest, org.bouncycastle.jcajce.provider.digest.GOST3411.Digest2012_256, org.bouncycastle.jcajce.provider.digest.GOST3411.Digest2012_512, org.bouncycastle.jcajce.provider.digest.Haraka.Digest256, org.bouncycastle.jcajce.provider.digest.Haraka.Digest512, org.bouncycastle.jcajce.provider.digest.Keccak.DigestKeccak, org.bouncycastle.jcajce.provider.digest.MD2.Digest, org.bouncycastle.jcajce.provider.digest.MD4.Digest, org.bouncycastle.jcajce.provider.digest.MD5.Digest, org.bouncycastle.jcajce.provider.digest.RIPEMD128.Digest, org.bouncycastle.jcajce.provider.digest.RIPEMD160.Digest, org.bouncycastle.jcajce.provider.digest.RIPEMD256.Digest, org.bouncycastle.jcajce.provider.digest.RIPEMD320.Digest, org.bouncycastle.jcajce.provider.digest.SHA1.Digest, org.bouncycastle.jcajce.provider.digest.SHA224.Digest, org.bouncycastle.jcajce.provider.digest.SHA256.Digest, org.bouncycastle.jcajce.provider.digest.SHA3.DigestSHA3, org.bouncycastle.jcajce.provider.digest.SHA3.DigestSHAKE, org.bouncycastle.jcajce.provider.digest.SHA3.DigestTupleHash, org.bouncycastle.jcajce.provider.digest.SHA3.DigestParallelHash, org.bouncycastle.jcajce.provider.digest.SHA384.Digest, org.bouncycastle.jcajce.provider.digest.SHA512.Digest, org.bouncycastle.jcajce.provider.digest.SHA512.DigestT, org.bouncycastle.jcajce.provider.digest.Skein.DigestSkein256, org.bouncycastle.jcajce.provider.digest.Skein.DigestSkein512, org.bouncycastle.jcajce.provider.digest.Skein.DigestSkein1024, org.bouncycastle.jcajce.provider.digest.SM3.Digest, org.bouncycastle.jcajce.provider.digest.Tiger.Digest, org.bouncycastle.jcajce.provider.digest.Whirlpool.Digest
Imports
java.security.DigestException, .MessageDigest, org.bouncycastle.crypto.Digest

Field Summary

Modifier and TypeField and Description
protected Digest
protected int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public byte[]
engineDigest()

Implements abstract java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding.

public int
engineDigest(byte[]
the output buffer in which to store the digest
buf
,
int
offset to start from in the output buffer
off
,
int
number of bytes within buf allotted for the digest. Both this default implementation and the SUN provider do not return partial digests. The presence of this parameter is solely for consistency in our API's. If the value of this parameter is less than the actual digest length, the method will throw a DigestException. This parameter is ignored if its value is greater than or equal to the actual digest length.
len
)

Overrides java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding.

public int
engineGetDigestLength()

Overrides java.security.MessageDigestSpi.engineGetDigestLength.

Returns the digest length in bytes.

public void
engineReset()

Implements abstract java.security.MessageDigestSpi.engineReset.

Resets the digest for further use.

public void
engineUpdate(byte
the byte to use for the update.
input
)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified byte.

public void
engineUpdate(byte[]
the array of bytes to use for the update.
input
,
int
the offset to start from in the array of bytes.
offset
,
int
the number of bytes to use, starting at offset.
len
)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified array of bytes, starting at the specified offset.

Inherited from java.security.MessageDigest:
clonedigestdigestdigestgetAlgorithmgetDigestLengthgetInstancegetInstancegetInstancegetProviderisEqualresettoStringupdateupdateupdateupdate

Field Detail

digestback to summary
protected Digest digest
digestSizeback to summary
protected int digestSize

Constructor Detail

BCMessageDigestback to summary
protected BCMessageDigest(Digest digest)

Method Detail

engineDigestback to summary
public byte[] engineDigest()

Implements abstract java.security.MessageDigestSpi.engineDigest.

Doc from java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding. Once engineDigest has been called, the engine should be reset (see engineReset). Resetting is the responsibility of the engine implementor.

Returns:byte[]

the array of bytes for the resulting hash value.

engineDigestback to summary
public int engineDigest(byte[] buf, int off, int len) throws DigestException

Overrides java.security.MessageDigestSpi.engineDigest.

Doc from java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding. Once engineDigest has been called, the engine should be reset (see engineReset). Resetting is the responsibility of the engine implementor. This method should be abstract, but we leave it concrete for binary compatibility. Knowledgeable providers should override this method.

Parameters
buf:byte[]

the output buffer in which to store the digest

off:int

offset to start from in the output buffer

len:int

number of bytes within buf allotted for the digest. Both this default implementation and the SUN provider do not return partial digests. The presence of this parameter is solely for consistency in our API's. If the value of this parameter is less than the actual digest length, the method will throw a DigestException. This parameter is ignored if its value is greater than or equal to the actual digest length.

Returns:int

the length of the digest stored in the output buffer.

Exceptions
DigestException:
if an error occurs.
engineGetDigestLengthback to summary
public int engineGetDigestLength()

Overrides java.security.MessageDigestSpi.engineGetDigestLength.

Doc from java.security.MessageDigestSpi.engineGetDigestLength.

Returns the digest length in bytes.

This concrete method has been added to this previously-defined abstract class. (For backwards compatibility, it cannot be abstract.)

The default behavior is to return 0.

This method may be overridden by a provider to return the digest length.

Returns:int

the digest length in bytes.

engineResetback to summary
public void engineReset()

Implements abstract java.security.MessageDigestSpi.engineReset.

Doc from java.security.MessageDigestSpi.engineReset.

Resets the digest for further use.

engineUpdateback to summary
public void engineUpdate(byte input)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Doc from java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified byte.

Parameters
input:byte

the byte to use for the update.

engineUpdateback to summary
public void engineUpdate(byte[] input, int offset, int len)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Doc from java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters
input:byte[]

the array of bytes to use for the update.

offset:int

the offset to start from in the array of bytes.

len:int

the number of bytes to use, starting at offset.