Utility functions for the DAS WEB Client.
- Version:
- 5.4.0.1765981380
- Copyright:
- © 2025 Nagravision
Methods
-
innercloseSession(sessionId){response}
Flush a given Session.
-
Name Type Description sessionIdstring A Session identifier
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of not passing Session.Will throw an
NV_DAS_ERROR_NO_SESSIONerror in case of failure to retrieve the Session.Will throw an
NV_DAS_ERRORerror in case of failure to close the Session.Returns:
Type Description response A response object with Session Closed. -
innerdecrypt(sessionId, keyId, data, IV){response}
Decrypt a data buffer.
-
Name Type Description sessionIdstring A Session identifier
keyIdstring A key idendifier
dataBuffer The data buffer to be decrypted
IVBuffer The IV buffer to be used for decryption
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of not passing session Id,KeyId,data,IV.Will throw an
NV_DAS_ERROR_CRYPTOENGINEerror in case of decryption failure.Will throw an
NV_DAS_ERROR_UNSUPPORTED_OPERATIONerror in case of passing incorrect key.Returns:
Type Description response A promise response object with the decrypted buffer. -
innerencrypt(sessionId, keyId, data, IV){response}
Encrypt a data buffer.
-
Name Type Description sessionIdstring A Session identifier
keyIdstring A key idendifier
dataBuffer The data buffer to be encrypted
IVBuffer The IV buffer to be used for encryption
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of not passing session Id,KeyId,data,IV.Will throw an
NV_DAS_ERROR_CRYPTOENGINEerror in case of encryption failure.Will throw an
NV_DAS_ERROR_UNSUPPORTED_OPERATIONerror in case of passing incorrect key.Returns:
Type Description response A promise response object with the encrypted buffer. -
innergetChallenge(sessionId){response}
Get the challenge associated to a Session.
-
Name Type Description sessionIdstring A Session identifier
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of failure to retrieve the Session.Returns:
Type Description response A response object with the challenge. -
innergetKeys(sessionId){response}
Retrieve key ids and usages of a given license.
-
Name Type Description sessionIdstring A Session identifier
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of failure to retrieve the Session.Returns:
Type Description response A response object containing Session keys.
Session keys are returned as a stringified json list of"keyId":[keyId], "usage":[usage]
Where[usage]possible values are"Encryption key"and"Signing key" -
innerimportLicense(sessionId, license){response}
Import a license linked to the provided Session.
-
Name Type Description sessionIdstring A Session identifier
licensestring A signed license
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of failure to retrieve the Session.Returns:
Type Description response A promise response object with OK/NOK. -
innerinit(operatorData){response}
Initialization of the DAS SDK.
-
Name Type Description operatorDatastring The JSON data or the URI of a valid opvault certificate
Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of not passing Url.Will throw an
NV_DAS_ERROR_INVALID_OPERATOR_CERTIFICATEerror in case of passing incorrect Url.Returns:
Type Description response Response object with NV_DAS_SUCCESS, if the SDK was initialized correctly. -
inneropenSession(){response}
Open a new Session.
-
Throws:
Type When Will throw an
NV_DAS_ERROR_NO_SESSIONerror in case of failure to create a new Session.Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of invalid opvault url.Returns:
Type Description response A promise response object with the sessionId.
sessionIdis auintof 13 digits or less. -
innersetOperatorUUID(the)
Set the UUID of the operator for TV Key. This method must be called before initialization of the DAS SDK.
-
Name Type Description thestring UUID of the operator.
-
innersign(sessionId, keyId, data, dataFormat){response}
Sign a data buffer.
-
Name Type Description sessionIdstring A Session identifier
keyIdstring A key identifier
datastring | arraystring | arraybuffer The data buffer to be signed
The buffer format can be one of the following:
string, as in
"hello"arraystring, as in
"1,2,3"arraybuffer, as in
[1,2,3]See
dataFormatparameter to specify the data buffer format.dataFormatstring optional and can take the following values:
"String", data is assumed to be a string as in"hello""ArrayString", data is assumed to be an array string as in"1,2,3""ArrayBuffer", data is assumed to be an array buffer as in[1,2,3]When
dataFormatis not specified, default value is"ArrayString"Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of failure to retrieve the Session.Will throw an
NV_DAS_ERROR_CRYPTOENGINEerror in case of signature failure.Will throw an
NV_DAS_ERROR_UNSUPPORTED_OPERATIONerror in case of passing incorrect key.Returns:
Type Description response A promise response object with the signature.
The signature will be returned as an array buffer, as in[1,2,3]. -
innerverify(sessionId, keyId, data, signature, dataFormat){response}
Verify a data buffer.
-
Name Type Description sessionIdstring A Session identifier
keyIdstring A key identifier
datastring | arraystring | arraybuffer The data buffer to be signed
The buffer format can be one of the following:
string, as in
"hello"arraystring, as in
"1,2,3"arraybuffer, as in
[1,2,3]See dataFormat parameter to specify the data buffer format.
signatureArrayString The signature of the data buffer
dataFormatstring dataFormat parameter is optional and can take the following values:
"String", data is assumed to be a string as in"hello""ArrayString", data is assumed to be an array string as in"1,2,3""ArrayBuffer", data is assumed to be an array buffer as in[1,2,3]When dataFormat is not specified, default value is
"ArrayString"Throws:
Type When Will throw an
NV_DAS_ERROR_BAD_PARAMETERerror in case of failure to retrieve the Session.Will throw an
NV_DAS_ERROR_CRYPTOENGINEerror in case of verification failure.Will throw an
NV_DAS_ERROR_UNSUPPORTED_OPERATIONerror in case of passing incorrect key.Returns:
Type Description response A promise response object with the verification result.