MGF1ParameterSpec
Stay organized with collections
Save and categorize content based on your preferences.
This class specifies the set of parameters used with mask generation
function MGF1 in OAEP Padding and RSA-PSS signature scheme, as
defined in the
PKCS #1 v2.1
standard.
Its ASN.1 definition in PKCS#1 standard is described below:
MGF1Parameters ::= OAEP-PSSDigestAlgorthms
where
OAEP-PSSDigestAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-sha1 PARAMETERS NULL }|
{ OID id-sha224 PARAMETERS NULL }|
{ OID id-sha256 PARAMETERS NULL }|
{ OID id-sha384 PARAMETERS NULL }|
{ OID id-sha512 PARAMETERS NULL },
... -- Allows for future expansion --
}
Public Constructor Summary
|
MGF1ParameterSpec( String mdName)
Constructs a parameter set for mask generation function MGF1
as defined in the PKCS #1 standard.
|
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Fields
public
static
final
MGF1ParameterSpec
SHA1
The MGF1ParameterSpec which uses "SHA-1" message digest.
public
static
final
MGF1ParameterSpec
SHA224
The MGF1ParameterSpec which uses "SHA-224" message digest.
public
static
final
MGF1ParameterSpec
SHA256
The MGF1ParameterSpec which uses "SHA-256" message digest.
public
static
final
MGF1ParameterSpec
SHA384
The MGF1ParameterSpec which uses "SHA-384" message digest.
public
static
final
MGF1ParameterSpec
SHA512
The MGF1ParameterSpec which uses SHA-512 message digest.
Public Constructors
public
MGF1ParameterSpec
(String mdName)
Constructs a parameter set for mask generation function MGF1
as defined in the PKCS #1 standard.
Parameters
mdName |
the algorithm name for the message digest
used in this mask generation function MGF1. |
Public Methods
public
String
getDigestAlgorithm
()
Returns the algorithm name of the message digest used by the mask
generation function.
Returns
- the algorithm name of the message digest.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eMGF1ParameterSpec\u003c/code\u003e defines parameters for the Mask Generation Function MGF1 used in OAEP padding and RSA-PSS signatures, as per PKCS #1 v2.1.\u003c/p\u003e\n"],["\u003cp\u003eIt specifies the message digest algorithm to be used with MGF1, such as SHA-1, SHA-224, SHA-256, SHA-384, or SHA-512.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can create an \u003ccode\u003eMGF1ParameterSpec\u003c/code\u003e instance by providing the desired message digest algorithm name.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetDigestAlgorithm()\u003c/code\u003e method allows retrieving the name of the message digest algorithm associated with the \u003ccode\u003eMGF1ParameterSpec\u003c/code\u003e instance.\u003c/p\u003e\n"]]],["`MGF1ParameterSpec` defines parameters for the MGF1 mask generation function in OAEP padding and RSA-PSS signatures, as per the PKCS #1 standard. Key actions include constructing a parameter set using a specified message digest algorithm name and retrieving the digest algorithm name. The class includes predefined fields for SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 digests, alongside a method to return the digest algorithm.\n"],null,["public class **MGF1ParameterSpec** extends [Object](../../../../reference/java/lang/Object.html) \nimplements [AlgorithmParameterSpec](../../../../reference/java/security/spec/AlgorithmParameterSpec.html) \nThis class specifies the set of parameters used with mask generation\nfunction MGF1 in OAEP Padding and RSA-PSS signature scheme, as\ndefined in the\n[PKCS #1 v2.1](http://www.ietf.org/rfc/rfc3447.txt)\nstandard.\n\nIts ASN.1 definition in PKCS#1 standard is described below: \n\n```\n MGF1Parameters ::= OAEP-PSSDigestAlgorthms\n \n```\nwhere \n\n```\n OAEP-PSSDigestAlgorithms ALGORITHM-IDENTIFIER ::= {\n { OID id-sha1 PARAMETERS NULL }|\n { OID id-sha224 PARAMETERS NULL }|\n { OID id-sha256 PARAMETERS NULL }|\n { OID id-sha384 PARAMETERS NULL }|\n { OID id-sha512 PARAMETERS NULL },\n ... -- Allows for future expansion --\n }\n \n```\n\n\u003cbr /\u003e\n\nSee Also\n\n- [PSSParameterSpec](../../../../reference/java/security/spec/PSSParameterSpec.html)\n- [OAEPParameterSpec](../../../../reference/javax/crypto/spec/OAEPParameterSpec.html) \n\nField Summary\n\n|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|------------------------------------------------------------|\n| public static final [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html) | [SHA1](../../../../reference/java/security/spec/MGF1ParameterSpec.html#SHA1) | The MGF1ParameterSpec which uses \"SHA-1\" message digest. |\n| public static final [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html) | [SHA224](../../../../reference/java/security/spec/MGF1ParameterSpec.html#SHA224) | The MGF1ParameterSpec which uses \"SHA-224\" message digest. |\n| public static final [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html) | [SHA256](../../../../reference/java/security/spec/MGF1ParameterSpec.html#SHA256) | The MGF1ParameterSpec which uses \"SHA-256\" message digest. |\n| public static final [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html) | [SHA384](../../../../reference/java/security/spec/MGF1ParameterSpec.html#SHA384) | The MGF1ParameterSpec which uses \"SHA-384\" message digest. |\n| public static final [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html) | [SHA512](../../../../reference/java/security/spec/MGF1ParameterSpec.html#SHA512) | The MGF1ParameterSpec which uses SHA-512 message digest. |\n\nPublic Constructor Summary\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [MGF1ParameterSpec](../../../../reference/java/security/spec/MGF1ParameterSpec.html#MGF1ParameterSpec(java.lang.String))([String](../../../../reference/java/lang/String.html) mdName) Constructs a parameter set for mask generation function MGF1 as defined in the PKCS #1 standard. |\n\nPublic Method Summary\n\n|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](../../../../reference/java/lang/String.html) | [getDigestAlgorithm](../../../../reference/java/security/spec/MGF1ParameterSpec.html#getDigestAlgorithm())() Returns the algorithm name of the message digest used by the mask generation function. |\n\nInherited Method Summary \nFrom class [java.lang.Object](../../../../reference/java/lang/Object.html) \n\n|----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](../../../../reference/java/lang/Object.html) | [clone](../../../../reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |\n| boolean | [equals](../../../../reference/java/lang/Object.html#equals(java.lang.Object))([Object](../../../../reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |\n| void | [finalize](../../../../reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |\n| final [Class](../../../../reference/java/lang/Class.html)\\\u003c?\\\u003e | [getClass](../../../../reference/java/lang/Object.html#getClass())() Returns the unique instance of [Class](../../../../reference/java/lang/Class.html) that represents this object's class. |\n| int | [hashCode](../../../../reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |\n| final void | [notify](../../../../reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| final void | [notifyAll](../../../../reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| [String](../../../../reference/java/lang/String.html) | [toString](../../../../reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../../reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |\n\nFields \n\npublic static final MGF1ParameterSpec\n**SHA1** \nThe MGF1ParameterSpec which uses \"SHA-1\" message digest. \n\npublic static final MGF1ParameterSpec\n**SHA224** \nThe MGF1ParameterSpec which uses \"SHA-224\" message digest. \n\npublic static final MGF1ParameterSpec\n**SHA256** \nThe MGF1ParameterSpec which uses \"SHA-256\" message digest. \n\npublic static final MGF1ParameterSpec\n**SHA384** \nThe MGF1ParameterSpec which uses \"SHA-384\" message digest. \n\npublic static final MGF1ParameterSpec\n**SHA512** \nThe MGF1ParameterSpec which uses SHA-512 message digest.\n\nPublic Constructors \n\npublic\n**MGF1ParameterSpec**\n([String](../../../../reference/java/lang/String.html) mdName) \nConstructs a parameter set for mask generation function MGF1\nas defined in the PKCS #1 standard. \n\nParameters\n\n| mdName | the algorithm name for the message digest used in this mask generation function MGF1. |\n|--------|---------------------------------------------------------------------------------------|\n\nThrows\n\n| [NullPointerException](../../../../reference/java/lang/NullPointerException.html) | if `mdName` is null. |\n|-----------------------------------------------------------------------------------|----------------------|\n\nPublic Methods \n\npublic [String](../../../../reference/java/lang/String.html)\n**getDigestAlgorithm**\n() \nReturns the algorithm name of the message digest used by the mask\ngeneration function. \n\nReturns\n\n- the algorithm name of the message digest."]]