Class Index | File Index


Class KJUR.asn1.DEROctetString

Extends KJUR.asn1.DERAbstractString.
class for ASN.1 DER OctetString
Defined in: asn1-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
class for ASN.1 DER OctetString
This class provides ASN.1 OctetString simple type.
Fields borrowed from class KJUR.asn1.DERAbstractString:
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified, params
Methods borrowed from class KJUR.asn1.DERAbstractString:
getString, setString, setStringHex
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
class for ASN.1 DER OctetString
This class provides ASN.1 OctetString simple type.
Supported "params" attributes are:
  • str - to set a string as a value
  • hex - to set a hexadecimal string as a value
  • obj - to set a encapsulated ASN.1 value by JSON object which is defined in KJUR.asn1.ASN1Util.newObject
NOTE: A parameter 'obj' have been supported for "OCTET STRING, encapsulates" structure. since asn1 1.0.11, jsrsasign 6.1.1 (2016-Sep-25).
// default constructor
o = new KJUR.asn1.DEROctetString();
// initialize with string
o = new KJUR.asn1.DEROctetString({str: "aaa"});
// initialize with hexadecimal string
o = new KJUR.asn1.DEROctetString({hex: "616161"});
// initialize with ASN1Util.newObject argument 
o = new KJUR.asn1.DEROctetString({obj: {seq: [{int: 3}, {prnstr: 'aaa'}]}});
// above generates a ASN.1 data like this:
// OCTET STRING, encapsulates {
//     INTEGER 3
//     PrintableString 'aaa'
//     }
//   }
{Array} params
associative array of parameters (ex. {'str': 'aaa'})
KJUR.asn1.DERAbstractString - superclass

© 2012-2023 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0