new SignedBlob(value, signedPortionBeginOffset, signedPortionEndOffset)
A SignedBlob extends Blob to keep the offsets of a signed portion (e.g., the
bytes of Data packet). This inherits from Blob, including Blob.size and Blob.buf.
Parameters:
Name | Type | Description |
---|---|---|
value |
Blob | Buffer | Array.<number> | (optional) If value is a Blob, take another pointer to the Buffer without copying. If value is a Buffer or byte array, copy to create a new Buffer. If omitted, buf() will return null. |
signedPortionBeginOffset |
number | (optional) The offset in the encoding of the beginning of the signed portion. If omitted, set to 0. |
signedPortionEndOffset |
number | (optional) The offset in the encoding of the end of the signed portion. If omitted, set to 0. |
- Source:
Methods
getSignedPortionBeginOffset() → {number}
Return the offset in the array of the beginning of the signed portion.
- Source:
Returns:
The offset in the array.
- Type
- number
getSignedPortionEndOffset() → {number}
Return the offset in the array of the end of the signed portion.
- Source:
Returns:
The offset in the array.
- Type
- number
signedBuf() → {Buffer}
Return a the signed portion of the immutable byte array.
- Source:
Returns:
A slice into the Buffer which is the signed portion.
If the pointer to the array is null, return null.
- Type
- Buffer
signedSize() → {number}
Return the length of the signed portion of the immutable byte array.
- Source:
Returns:
The length of the signed portion. If signedBuf() is null,
return 0.
- Type
- number