chapter3
Class MGF1

java.lang.Object
  extended by chapter3.MGF1

public class MGF1
extends java.lang.Object

mask generator function, as described in PKCS1v2.


Constructor Summary
MGF1(java.security.MessageDigest digest)
          Create a version of MGF1 for the given digest.
 
Method Summary
 byte[] generateMask(byte[] seed, int length)
          Generate the mask.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MGF1

public MGF1(java.security.MessageDigest digest)
Create a version of MGF1 for the given digest.

Parameters:
digest - digest to use as the basis of the function.
Method Detail

generateMask

public byte[] generateMask(byte[] seed,
                           int length)
Generate the mask.

Parameters:
seed - source of input bytes for initial digest state
length - length of mask to generate
Returns:
a byte array containing a MGF1 generated mask

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Examples from "Beginning Cryptography with Java"