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.EME_PKCS1_V1_5
public class EME_PKCS1_V1_5
extends Object
EME-PKCS1-V1.5 is parameterised by the entity k
which is the
byte count of an RSA public shared modulus.
References:
Method Summary | |
byte[] |
|
byte[] |
|
byte[] |
|
byte[] |
|
static EME_PKCS1_V1_5 |
|
static EME_PKCS1_V1_5 |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public byte[] decode(byte[] EM)
Separate the encoded messageEM
into an octet stringPS
consisting of nonzero octets and a messageM
as:EM = 0x00 || 0x02 || PS || 0x00 || M.If the first octet of
EM
does not have hexadecimal value0x00
, if the second octet ofEM
does not have hexadecimal value0x02
, if there is no octet with hexadecimal value0x00
to separatePS
fromM
, or if the length ofPS
is less than8
octets, output "decryption error" and stop.
- Parameters:
EM
- the designated encoded message.
- Returns:
- the decoded message
M
framed in the designatedEM
value.
- Throws:
IllegalArgumentException
- if the length of the designated entityEM
is different thank
(the length in bytes of the public shared modulus), or if any of the conditions described above is detected.
public byte[] encode(byte[] M)
Generates an octet stringPS
of lengthk - mLen - 3
consisting of pseudo-randomly generated nonzero octets. The length ofPS
will be at least eight octets.The method then concatenates
PS
, the messageM
, and other padding to form an encoded messageEM
of lengthk
octets as:EM = 0x00 || 0x02 || PS || 0x00 || M.This method uses a default PRNG to obtain the padding bytes.
- Parameters:
M
- the message to encode.
- Returns:
- the encoded message
EM
.
public byte[] encode(byte[] M, IRandom irnd)
Similar toencode(byte[])
method, except that the source of randomness to use for obtaining the padding bytes (an instance ofIRandom
) is given as a parameter.
- Parameters:
M
- the message to encode.irnd
- theIRandom
instance to use as a source of randomness.
- Returns:
- the encoded message
EM
.
public byte[] encode(byte[] M, Random rnd)
Similar to theencode(byte[],IRandom)
method, except that the source of randmoness is an instance ofRandom
.
- Parameters:
M
- the message to encode.rnd
- theRandom
instance to use as a source of randomness.
- Returns:
- the encoded message
EM
.