Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.java.security.sig.rsa.EMSA_PKCS1_V1_5
EMSA-PKCS1-V1.5 is parameterised by the choice of hash function Hash and hLen which denotes the length in octets of the hash function output.
References:
Method Summary | |
Object |
|
byte[] |
|
static EMSA_PKCS1_V1_5 |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public Object clone()
This method may be called to create a new copy of the Object. The typical behavior is as follows:
o == o.clone()
is falseo.getClass() == o.clone().getClass()
is trueo.equals(o)
is trueHowever, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override
Object.equals(Object)
.If the Object you call clone() on does not implement
Cloneable
(which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override this method as follows (it should never fail):
public Object clone() { try { super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } }
- Returns:
- a copy of the Object
- See Also:
Cloneable
public byte[] encode(byte[] mHash, int emLen)
Frames the hash of a message, along with an ID of the hash function in a DER sequence according to the specifications of EMSA-PKCS1-V1.5 as described in RFC-3447 (see class documentation).
- Parameters:
mHash
- the byte sequence resulting from applying the message digest algorithm Hash to the message M.emLen
- intended length in octets of the encoded message, at leasttLen + 11
, wheretLen
is the octet length of the DER encodingT
of a certain value computed during the encoding operation.
- Returns:
- encoded message, an octet string of length
emLen
.
- Throws:
IllegalArgumentException
- if the message is too long, or if the intended encoded message length is too short.
public static final EMSA_PKCS1_V1_5 getInstance(String mdName)
Returns an instance of this object given a designated name of a hash function.
- Parameters:
mdName
- the canonical name of a hash function.
- Returns:
- an instance of this object configured for use with the designated options.
- Throws:
UnsupportedOperationException
- if the hash function is not implemented or does not have an ID listed in RFC-3447.