JsDoc Reference - DNEncoder

Class Index | File Index

## Classes

- _global_
- AccessController
- APDU
- AuthenticationObject
- CAConnection
- ChipAuthentication
- ChipAuthenticationDomainParameterInfo
- ChipAuthenticationInfo
- ChipAuthenticationPublicKeyInfo
- CommandInterpreter
- CRLGenerator
- CVC
- CVCCA
- CVCertificateStore
- DataUnitAPDU
- DF
- DKEK
- DNEncoder
- EAC20
- EAC2CVCertificateGenerator
- EAC2CVRequestGenerator
- FCP
- File
- FileEncryptor
- FileSelector
- FileSystemIdObject
- FSNode
- GPSCP03
- HSMCVCertificateStore
- HSMKeyStore
- LinearEF
- ManagePKA
- P11CVCertificateStore
- PACE
- PACEDomainParameterInfo
- PACEInfo
- PaperKeyEncoding
- PKCS10Generator
- PublicKeyFile
- PublicKeyReference
- RAMClient
- RestrictedIdentificationDomainParameterInfo
- RestrictedIdentificationInfo
- SecureChannelHandler
- SecureMessagingCommandAPDUDecoder
- SecurityEnvironment
- SignatureKey
- SmartCardHSM
- SmartCardHSMCrypto
- SmartCardHSMInitializer
- SmartCardHSMKey
- SmartCardHSMKeySpecGenerator
- SmartCardHSMSymmetricKeySpecGenerator
- TransparentEF
- TrustAnchor
- X509CertificateGenerator
- X509CertificateIssuer
- X509CertificateStore
- X509Signer

# 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() 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() 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 Wed Mar 18 2026 21:29:18 GMT+0100 (CET)