
org.spongycastle.pqc.crypto.DigestingStateAwareMessageSigner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
The newest version!
package org.spongycastle.pqc.crypto;
import org.spongycastle.crypto.Digest;
import org.spongycastle.crypto.params.AsymmetricKeyParameter;
/**
* Implements the sign and verify functions for a Signature Scheme using a hash function to allow processing of large messages.
*
* This class can be used with algorithms where the state associated with the private key changes as each signature is
* generated. Calling getUpdatedPrivateKey() will recover the private key that can be used to initialize a signer
* next time around.
*
*/
public class DigestingStateAwareMessageSigner
extends DigestingMessageSigner
{
private final StateAwareMessageSigner signer;
public DigestingStateAwareMessageSigner(StateAwareMessageSigner messSigner, Digest messDigest)
{
super(messSigner, messDigest);
this.signer = messSigner;
}
/**
* Return the current version of the private key with the updated state.
*
* Note: calling this method will effectively disable the Signer from being used for further
* signature generation without another call to init().
*
* @return an updated private key object, which can be used for later signature generation.
*/
public AsymmetricKeyParameter getUpdatedPrivateKey()
{
return signer.getUpdatedPrivateKey();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy