Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class PasswordBasedMAC

`java.lang.Object
oracle.security.crypto.core.MessageDigest
oracle.security.crypto.core.PasswordBasedMAC`

All Implemented Interfaces:
  java.lang.Cloneable

public class PasswordBasedMAC
extends MessageDigest

The password-base MAC algorithm, as defined in CRMF (RFC 2511).

See Also:
  `PBMacAlgID`

Nested Class Summary

Nested classes inherited from class oracle.security.crypto.core.MessageDigest
`MessageDigest.MDState`

Field Summary
`static int` | `DEFAULT_ITER_COUNT` Default password-based key derivation iteration count.
`static AlgorithmIdentifier` | `DEFAULT_MAC` Default password-based MAC algorithm is HMAC-SHA.
`static AlgorithmIdentifier` | `DEFAULT_OWF` Default password-based key derivation hash function is SHA-1.
`static int` | `DEFAULT_SALT_LEN` Default password-based key derivation salt length.

Fields inherited from class oracle.security.crypto.core.MessageDigest
`algID, digestBits, digestValid`

Constructor Summary
`PasswordBasedMAC()`
`PasswordBasedMAC(AlgorithmIdentifier algID, byte[] password)`
`PasswordBasedMAC(AlgorithmIdentifier algID, byte[] password, RandomBitsSource rbs)` Use this constructor if `algID` does not contain parameters -- the `RandomBitsSource` will be used to generate the salt bytes.
`PasswordBasedMAC(byte[] password)`

Method Summary
`java.lang.String` | `algName()` Returns the algorithm name of this message digest.
`int` | `blockSize()`
`java.lang.Object` | `clone()` Returns a clone of this message digest object.
`void` | `computeCurrent()` Completes the hash computation, performing any necessary operations such as padding.
`AlgorithmIdentifier` | `getAlgID()` Returns the algorithm identifier for this `PasswordBasedMAC`.
`int` | `getCount()`
`int` | `getDigestLength()` Returns the length in bytes of the message digest.
`AlgorithmIdentifier` | `getMacAlgID()`
`AlgorithmIdentifier` | `getOwfAlgID()`
`byte[]` | `getSalt()`
`protected MessageDigest.MDState` | `getState()`
`void` | `init()` Resets this message digest object to its initial state.
`void` | `setAlgID(AlgorithmIdentifier algID)`
`void` | `setCount(int count)`
`void` | `setMacAlgID(AlgorithmIdentifier macAlgID)`
`void` | `setOwfAlgID(AlgorithmIdentifier owfAlgID)`
`void` | `setPassword(byte[] password)`
`void` | `setRandomBitsSource(RandomBitsSource rbs)`
`void` | `setSalt(byte[] salt)`
`protected void` | `setState(MessageDigest.MDState state)`
`void` | `update(byte b)` Adds the specifed byte to the data being digested.
`void` | `update(byte[] input, int off, int len)` Adds the specified sequence of bytes to the data being digested.

Methods inherited from class oracle.security.crypto.core.MessageDigest
`computeDigest, computeDigest, getDigestBits, getInstance, isEqual, isEqual, toString, update, update, update, update, update, update, update, update, update, update, updateASCII`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_SALT_LEN

    public static final int DEFAULT_SALT_LEN

  Default password-based key derivation salt length.
  See Also:
    `PKCS5.DEFAULT_SALT_LEN`, Constant Field Values

### DEFAULT_OWF

    public static final AlgorithmIdentifier DEFAULT_OWF

  Default password-based key derivation hash function is SHA-1.

### DEFAULT_ITER_COUNT

    public static final int DEFAULT_ITER_COUNT

  Default password-based key derivation iteration count.
  See Also:
    `PKCS5.DEFAULT_ITER_COUNT`, Constant Field Values

### DEFAULT_MAC

    public static final AlgorithmIdentifier DEFAULT_MAC

  Default password-based MAC algorithm is HMAC-SHA.

Constructor Detail

### PasswordBasedMAC

    public PasswordBasedMAC()

### PasswordBasedMAC

    public PasswordBasedMAC(byte[] password)
                     throws AlgorithmIdentifierException

### PasswordBasedMAC

    public PasswordBasedMAC(AlgorithmIdentifier algID,
                            byte[] password)
                     throws AlgorithmIdentifierException

### PasswordBasedMAC

    public PasswordBasedMAC(AlgorithmIdentifier algID,
                            byte[] password,
                            RandomBitsSource rbs)
                     throws AlgorithmIdentifierException

  Use this constructor if `algID` does not contain parameters -- the `RandomBitsSource` will be used to generate the salt bytes.

Method Detail

### setAlgID

    public void setAlgID(AlgorithmIdentifier algID)
                  throws AlgorithmIdentifierException

  Overrides:
    `setAlgID` in class `MessageDigest`
  Throws:
    `AlgorithmIdentifierException`

### getAlgID

    public AlgorithmIdentifier getAlgID()

  Returns the algorithm identifier for this `PasswordBasedMAC`. If all of the paramter fields (salt, one way function algorithm, iteration count and MAC algorithm) are defined (or defaults can be used), then a new `PBMacAlgID` containing the parameters is returned; otherwise a `PBMacAlgID` with no paramters is returned.
  Specified by:
    `getAlgID` in class `MessageDigest`

### setSalt

    public void setSalt(byte[] salt)

### getSalt

    public byte[] getSalt()

### setOwfAlgID

    public void setOwfAlgID(AlgorithmIdentifier owfAlgID)
                     throws AlgorithmIdentifierException

  Throws:
    `AlgorithmIdentifierException`

### getOwfAlgID

    public AlgorithmIdentifier getOwfAlgID()

### setCount

    public void setCount(int count)

### getCount

    public int getCount()

### setMacAlgID

    public void setMacAlgID(AlgorithmIdentifier macAlgID)
                     throws AlgorithmIdentifierException

  Throws:
    `AlgorithmIdentifierException`

### getMacAlgID

    public AlgorithmIdentifier getMacAlgID()

### setRandomBitsSource

    public void setRandomBitsSource(RandomBitsSource rbs)

### setPassword

    public void setPassword(byte[] password)

### init

    public void init()

  Description copied from class: `MessageDigest`
  Resets this message digest object to its initial state.
  Specified by:
    `init` in class `MessageDigest`

### blockSize

    public int blockSize()

  Specified by:
    `blockSize` in class `MessageDigest`

### update

    public void update(byte b)

  Description copied from class: `MessageDigest`
  Adds the specifed byte to the data being digested.
  Specified by:
    `update` in class `MessageDigest`

### update

    public void update(byte[] input,
                       int off,
                       int len)

  Description copied from class: `MessageDigest`
  Adds the specified sequence of bytes to the data being digested.
  Overrides:
    `update` in class `MessageDigest`
  Parameters:
    `input` - the input array
    `off` - start position in the input array
    `len` - the number of input array elements to add to the data being digested

### computeCurrent

    public void computeCurrent()

  Description copied from class: `MessageDigest`
  Completes the hash computation, performing any necessary operations such as padding. The result of the hash can be obtained using `MessageDigest.getDigestBits()`.
  Specified by:
    `computeCurrent` in class `MessageDigest`

### algName

    public java.lang.String algName()

  Description copied from class: `MessageDigest`
  Returns the algorithm name of this message digest.
  Specified by:
    `algName` in class `MessageDigest`

### getDigestLength

    public int getDigestLength()

  Description copied from class: `MessageDigest`
  Returns the length in bytes of the message digest.
  Specified by:
    `getDigestLength` in class `MessageDigest`

### clone

    public java.lang.Object clone()

  Description copied from class: `MessageDigest`
  Returns a clone of this message digest object.
  Specified by:
    `clone` in class `MessageDigest`

### getState

    protected MessageDigest.MDState getState()

  Specified by:
    `getState` in class `MessageDigest`

### setState

    protected void setState(MessageDigest.MDState state)

  Specified by:
    `setState` in class `MessageDigest`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.