Class Index | File Index

Classes


Class DNEncoder


Defined in: DNEncoder.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DNEncoder(mask)
An instance of this class allow generating a Distinguished Name from components defined in the mask given as constructor.
Method Summary
Method Attributes Method Name and Description
 
Encode DN based on mask and previously set objects
 
setDN(name, dn)
Register a DN under the given name.
 
setMap(name, map)
Register an object and it properties the given name.
 
Validate DN mask against previously set reference objects DN objects can be set with setDN(name, {}).
Class Detail
DNEncoder(mask)
An instance of this class allow generating a Distinguished Name from components defined in the mask given as constructor. The mask may contain placeholders in the form ${major.minor} that are resolved against other DNs and objects set with setDN() or setMap().
Parameters:
{String} mask
the mask for generating the DN
Method Detail
{Object} encode()
Encode DN based on mask and previously set objects
Returns:
DN in the format as returned by PKIXCommon.parseDN()

setDN(name, dn)
Register a DN under the given name. Elements in the DN can be referenced by ${major.minor} with major set to the name given as argument and minor being the component in the given DN.
Parameters:
{String} name
the name for the major key
{String/Object} dn
the Distinguished Name given as String or in the format returned by PKIXCommon.parseDN.

setMap(name, map)
Register an object and it properties the given name. Elements in the object can be referenced by ${major.minor} with major set to the name given as argument and minor being the member of the given object.
Parameters:
{String} name
the name for the major key
{Object} map
the map object

validate()
Validate DN mask against previously set reference objects DN objects can be set with setDN(name, {}). The minor key is validated against the list of valid RDN as defined in PKIXCommon.validRDN. Other objects can be set with setMap(), but only the key names in the map are relevant. If the object contains the property "any", then any minor keys are acceptable. The method will throw an exception if a key is invalid.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Feb 16 2024 18:38:12 GMT+0100 (CET)