Class: KeyLocator

KeyLocator()

new KeyLocator()

Source:

Methods

(static) canGetFromSignature(signature) → {boolean}

If the signature is a type that has a KeyLocator (so that, getFromSignature will succeed), return true. Note: This is a static method of KeyLocator instead of a method of Signature so that the Signature base class does not need to be overloaded with all the different kinds of information that various signature algorithms may use.
Parameters:
Name Type Description
signature Signature An object of a subclass of Signature.
Source:
Returns:
True if the signature is a type that has a KeyLocator, otherwise false.
Type
boolean

(static) getFromSignature(signature) → {KeyLocator}

If the signature is a type that has a KeyLocator, then return it. Otherwise throw an error.
Parameters:
Name Type Description
signature Signature An object of a subclass of Signature.
Source:
Returns:
The signature's KeyLocator. It is an error if signature doesn't have a KeyLocator.
Type
KeyLocator

clear()

Clear the keyData and set the type to not specified.
Source:

equals(other) → {boolean}

Check if this key locator has the same values as the given key locator.
Parameters:
Name Type Description
other KeyLocator The other key locator to check.
Source:
Returns:
true if the key locators are equal, otherwise false.
Type
boolean

getChangeCount() → {number}

Get the change count, which is incremented each time this object (or a child object) is changed.
Source:
Returns:
The change count.
Type
number

getKeyData() → {Blob}

Get the key data. If getType() is KeyLocatorType.KEY_LOCATOR_DIGEST, this is the digest bytes.
Source:
Returns:
The key data, or an isNull Blob if not specified.
Type
Blob

getKeyDataAsBuffer()

Deprecated:
  • Use getKeyData. This method returns a Buffer which is the former behavior of getKeyData, and should only be used while updating your code.
Source:

getKeyName() → {Name}

Get the key name. This is meaningful if getType() is KeyLocatorType.KEYNAME.
Source:
Returns:
The key name. If not specified, the Name is empty.
Type
Name

getType() → {number}

Get the key locator type. If KeyLocatorType.KEYNAME, you may also getKeyName(). If KeyLocatorType.KEY_LOCATOR_DIGEST, you may also getKeyData() to get the digest.
Source:
Returns:
The key locator type as a KeyLocatorType enum value, or null if not specified.
Type
number

setKeyData(keyData)

Set the key data to the given value. This is the digest bytes if getType() is KeyLocatorType.KEY_LOCATOR_DIGEST.
Parameters:
Name Type Description
keyData Blob A Blob with the key data bytes.
Source:

setKeyName(name)

Set key name to a copy of the given Name. This is the name if getType() is KeyLocatorType.KEYNAME.
Parameters:
Name Type Description
name Name The key name which is copied.
Source:

setType(type)

Set the key locator type. If KeyLocatorType.KEYNAME, you must also setKeyName(). If KeyLocatorType.KEY_LOCATOR_DIGEST, you must also setKeyData() to the digest.
Parameters:
Name Type Description
type number The key locator type as a KeyLocatorType enum value. If null, the type is unspecified.
Source: