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

## oracle.security.xmlsec.saml
Class Artifact

`java.lang.Object
oracle.security.xmlsec.saml.Artifact`

public class Artifact
extends java.lang.Object

A SAML artifact.

The artifact consists of the base64 encoding of the following byte format:

- TypeCode - A 2-byte code identifying the type of artifact. This is defined to be `0x0001` for SAML version 1.0, but may hold different values for other profiles.
- SourceID - A 20-byte value that uniquely identifies the source of the artifact. This should be generated by computing the SHA-1 hash of the source sites identification URL.
- AssertionHandle - A 20-byte value used to identify an assertion that is stored or generated by the source site. It must be infeasible to guess a valid/outstanding value, and there should be no predictable relationship between this value and the contents of the referenced assertion. At least 8 bytes of this value should be obtained from a cryptographically secure RNG or PRNG.

Since:
  2.0

Constructor Summary
`Artifact()` Creates a new `Artifact` instance with TypeCode = `0x0001` and `null` values for SourceID and AssertionHandle.
`Artifact(byte[] artifactBytes)` Creates a new `Artifact` instance by parsing the TypeCode, SourceID and AssertionHandle from the given byte array.
`Artifact(byte[] sourceID, byte[] assertionHandle)` Creates a new `Artifact` instance with TypeCode = `0x0001` and the given SourceID and AssertionHandle.
`Artifact(short typeCode, byte[] sourceID, byte[] assertionHandle)` Creates a new `Artifact` instance with the given TypeCode, SourceID and AssertionHandle.
`Artifact(java.lang.String artifactString)` Creates a new `Artifact` instance by parsing the TypeCode, SourceID and AssertionHandle from the given base64-encoded artifact string.

Method Summary
`byte[]` | `getAssertionHandle()` Returns the assertion handle of this SAML artifact.
`byte[]` | `getBytes()` Returns the bytes of this SAML artifact.
`byte[]` | `getSourceID()` Returns the source ID of this SAML artifact.
`short` | `getTypeCode()` Returns the type code of this SAML artifact.
`void` | `setAssertionHandle(byte[] assertionHandle)` Sets the assertion handle of this SAML artifact.
`void` | `setSourceID(byte[] sourceID)` Sets the source ID of this SAML artifact.
`void` | `setTypeCode(short typeCode)` Sets the type code of this SAML artifact.
`void` | `setValue(byte[] artifactBytes)` Sets the value of this SAML artifact, and parses the TypeCode, SourceID and AssertionHandle from the given byte array.
`void` | `setValue(java.lang.String artifactString)` Sets the value of this SAML artifact, and parses the TypeCode, SourceID and AssertionHandle from the given string.
`java.lang.String` | `toString()` Returns the base64-encoded artifact string.

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

Constructor Detail

### Artifact

    public Artifact()

  Creates a new `Artifact` instance with TypeCode = `0x0001` and `null` values for SourceID and AssertionHandle.

### Artifact

    public Artifact(byte[] sourceID,
                    byte[] assertionHandle)

  Creates a new `Artifact` instance with TypeCode = `0x0001` and the given SourceID and AssertionHandle.
Parameters:
  `sourceID` - The identifier for the artifact's source site.
  `assertionHandle` - The reference value for the assertion on the source site.
Throws:
  `java.lang.IllegalArgumentException` - If the given source ID or assertion handle does not conform to the format defined in the SAML 1.0 specification.

### Artifact

    public Artifact(short typeCode,
                    byte[] sourceID,
                    byte[] assertionHandle)

  Creates a new `Artifact` instance with the given TypeCode, SourceID and AssertionHandle.
Parameters:
  `typeCode` - The type code for this artifact.
  `sourceID` - The identifier for the artifact's source site.
  `assertionHandle` - The reference value for the assertion on the source site.
Throws:
  `java.lang.IllegalArgumentException` - If the given source ID or assertion handle does not conform to the format defined in the SAML 1.0 specification.

### Artifact

    public Artifact(java.lang.String artifactString)

  Creates a new `Artifact` instance by parsing the TypeCode, SourceID and AssertionHandle from the given base64-encoded artifact string.
Parameters:
  `artifactString` - A base64-encoded SAML artifact string that conforms to the format defined in the SAML 1.0 specification.
Throws:
  `java.lang.IllegalArgumentException` - If the artifact does not conform to the format defined in the SAML 1.0 specification.

### Artifact

    public Artifact(byte[] artifactBytes)

  Creates a new `Artifact` instance by parsing the TypeCode, SourceID and AssertionHandle from the given byte array.
Parameters:
  `artifactBytes` - The bytes of a SAML artifact that conforms to the format defined in the SAML 1.0 specification.
Throws:
  `java.lang.IllegalArgumentException` - If the artifact does not conform to the format defined in the SAML 1.0 specification.

Method Detail

### getTypeCode

    public short getTypeCode()

  Returns the type code of this SAML artifact.
  Returns:
    The value of the TypeCode field of this artifact.

### setTypeCode

    public void setTypeCode(short typeCode)

  Sets the type code of this SAML artifact.
  Parameters:
    `typeCode` - The type code for this artifact.

### getSourceID

    public byte[] getSourceID()

  Returns the source ID of this SAML artifact.
  Returns:
    The value of the SourceID field, or `null` if none has been set.

### setSourceID

    public void setSourceID(byte[] sourceID)

  Sets the source ID of this SAML artifact.
  Parameters:
    `sourceID` - The identifier for the artifact's source site.
  Throws:
    `java.lang.IllegalArgumentException` - If the given source ID does not conform to the format defined in the SAML 1.0 specification.

### getAssertionHandle

    public byte[] getAssertionHandle()

  Returns the assertion handle of this SAML artifact.
  Returns:
    The value of the AssertionHandle field, or `null` if none has been set.

### setAssertionHandle

    public void setAssertionHandle(byte[] assertionHandle)

  Sets the assertion handle of this SAML artifact.
  Parameters:
    `assertionHandle` - The reference value for the assertion on the source site.
  Throws:
    `java.lang.IllegalArgumentException` - If the given assertion handle does not conform to the format defined in the SAML 1.0 specification.

### getBytes

    public byte[] getBytes()

  Returns the bytes of this SAML artifact.
  Returns:
    A byte array consisting of the concatenation of the TypeCode, SourceID (if present) and the AssertionHandle (if present).

### toString

    public java.lang.String toString()

  Returns the base64-encoded artifact string.
  Returns:
    The base64 encoding of the bytes of this artifact.

### setValue

    public void setValue(byte[] artifactBytes)

  Sets the value of this SAML artifact, and parses the TypeCode, SourceID and AssertionHandle from the given byte array.
  Parameters:
    `artifactBytes` - The bytes of a SAML artifact that conforms to the format defined in the SAML 1.0 specification.
  Throws:
    `java.lang.IllegalArgumentException` - If the artifact does not conform to the format defined in the SAML 1.0 specification.

### setValue

    public void setValue(java.lang.String artifactString)

  Sets the value of this SAML artifact, and parses the TypeCode, SourceID and AssertionHandle from the given string.
  Parameters:
    `artifactString` - A base64-encoded SAML artifact string that conforms to the format defined in the SAML 1.0 specification.
  Throws:
    `java.lang.IllegalArgumentException` - If the artifact does not conform to the format defined in the SAML 1.0 specification.

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

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