org.clazzes.optional.sec.rsa
Class MGF1

java.lang.Object
  extended by org.clazzes.optional.sec.rsa.MGF1
All Implemented Interfaces:
MGF

public class MGF1
extends java.lang.Object
implements MGF

The mask generation function no. 1 for the OAEP algorithm as defined in Appendix B.2.1 of RFC 3447.


Constructor Summary
MGF1(Digest digest)
           
 
Method Summary
 byte[] generateMask(byte[] mgfSeed, int seedOff, int seedLen, byte[] ret, int off, int maskLen)
          Generate maskLen mask bytes from a seed.
 Digest getUnderlyingDigest()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MGF1

public MGF1(Digest digest)
Method Detail

generateMask

public byte[] generateMask(byte[] mgfSeed,
                           int seedOff,
                           int seedLen,
                           byte[] ret,
                           int off,
                           int maskLen)
Description copied from interface: MGF
Generate maskLen mask bytes from a seed.

Specified by:
generateMask in interface MGF
Parameters:
mgfSeed - The seed value.
seedOff - The offset of the seed in mgfSeed.
seedLen - The number of seed bytes mgfSeed to use.
ret - The byte array where the result is beings stored.
off - The offset in ret where to store the result.
maskLen - The number of octets to generate.
Returns:
An array of pseudo-random, maskLen bytes.

getUnderlyingDigest

public Digest getUnderlyingDigest()
Specified by:
getUnderlyingDigest in interface MGF
Returns:
The message digest, which is used by this mask generator.


Copyright © 2010. All Rights Reserved.