Class SCPSSPadding
java.lang.Object
se.swedenconnect.opensaml.xmlsec.signature.support.provider.padding.SCPSSPadding
Implements the RSA-PSS padding algorithm in accordance with PKCS#1 v2.1.
- Author:
- Stefan Santesson (stefan@idsec.se), Martin Lindström (martin@idsec.se)
-
Constructor Summary
ConstructorDescriptionSCPSSPadding
(MessageDigest messageDigest, int modulusBits) Constructor for the PSS padding generator. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getPadding
(byte[] messageHash) Calculates the padding for a message hash.byte[]
getPaddingFromMessage
(byte[] message) Generates RSA-PSS encoded message (EM) for a given message.void
setSalt
(byte[] salt) Inject a predefined salt value
-
Constructor Details
-
SCPSSPadding
Constructor for the PSS padding generator. This padding generator uses the default parameter structure of RSA-PSS where message digest equals MGF hash function and where salt length equals hash length and finally where the final byte is set to 0xBC.- Parameters:
messageDigest
- Message digest functionmodulusBits
- number of modulus bits of the RSA key
-
-
Method Details
-
setSalt
public void setSalt(byte[] salt) Inject a predefined salt value- Parameters:
salt
- predefined salt value;
-
getPaddingFromMessage
public byte[] getPaddingFromMessage(byte[] message) Generates RSA-PSS encoded message (EM) for a given message.- Parameters:
message
- message- Returns:
- encoded message (EM) for RSA PSS
-
getPadding
Calculates the padding for a message hash.- Parameters:
messageHash
- message hash- Returns:
- encoded message (EM) for RSA PSS
- Throws:
IllegalArgumentException
- if specified modulus is too short
-