Static ReadonlyAES128_AES-128-CBC, without integrity.
Static ReadonlyAES128_AES-128-GCM.
Static ReadonlyAES192_AES-192-CBC, without integrity.
Static ReadonlyAES192_AES-192-GCM.
Static ReadonlyAES256_AES-256-CBC, without integrity.
Static ReadonlyAES256_AES-256-GCM (default).
Static ReadonlyC14Inclusive canonicalization (default).
Static ReadonlyC14Inclusive canonicalization, with comments.
Static ReadonlyDESYNC_The clock offset (in seconds) allowed by isOutOfDate() for a token
whose timestamp is in the future.
Static ReadonlyEXC_Exclusive canonicalization.
Static ReadonlyEXC_Exclusive canonicalization, with comments.
Static ReadonlyRIPEMD160RIPEMD-160.
Static ReadonlyRSA_RSA-OAEP with MGF1-SHA1 (default key transport).
Static ReadonlyRSA_RSA-SHA1.
Static ReadonlyRSA_RSA-SHA256 (default).
Static ReadonlyRSA_RSA-SHA384.
Static ReadonlyRSA_RSA-SHA512.
Static ReadonlySHA1SHA-1.
Static ReadonlySHA256SHA-256 (default).
Static ReadonlySHA384SHA-384.
Static ReadonlySHA512SHA-512.
Static ReadonlyTOKEN_The name of the node that holds one audience of the token.
Static ReadonlyTOKEN_The name of the token data node.
Static ReadonlyTOKEN_The default time to live (in seconds) used by isOutOfDate().
Static ReadonlyTOKEN_The name of the token expiry node.
Static ReadonlyTOKEN_The number of random bytes of the token identifier, written in
hexadecimal (see getTokenId()).
Static ReadonlyTOKEN_The name of the token identifier node.
Static ReadonlyTOKEN_The name of the token node.
Static ReadonlyTOKEN_The format of the token timestamp, in the notation of PHP (YYYY-MM-DDThh:mm:ssZ, in UTC).
Static ReadonlyTOKEN_The name of the token timestamp node.
Static ReadonlyTRIPLEDES_Triple DES CBC, without integrity.
Static ReadonlyXMLDSIG_The default XMLDSIG namespace prefix used in the XML digital signature.
What console.log() and util.inspect() show: the results of the
analysis, without the keys.
Gets the anomalies detected by the analysis.
Gets the audiences of a valid token, or null if it names none.
Gets the Distinguished Name of the certificate of the token (see
X509Cert.getDN()).
Gets the X.509 certificate of the token, in PEM format.
Gets the fields of the issuer of the certificate of the token.
Gets the fields of the subject of the certificate of the token.
Gets the date from which the certificate of the token is valid.
Gets the date until which the certificate of the token is valid.
Gets the token data. They can only be trusted if isSignatureValid()
returns true (and the token is neither out of date nor replayed).
Values written empty are not read back, as with the PHP library.
Gets the error of the analysis, or null.
Gets the expiry of a valid token (YYYY-MM-DDThh:mm:ssZ, UTC), or null if it has none.
Gets the XML token in a readable form, for display only: use
getXML() to get the token to work with. The signature value, the
certificate and the encrypted values are split into lines of 64
characters, and the elements are indented by 2 spaces. The result is
the one of getPrettyXML() of the PHP library, whose steps it follows.
A token that is not an XML document is returned as it is, one line per
line.
Gets the timestamp of a valid token (YYYY-MM-DDThh:mm:ssZ, UTC).
Gets the identifier of a valid token: 128 random bits, in 32 lowercase
hexadecimal characters, covered by the signature. The library keeps no
list of the tokens it analyzed: refuse a token whose identifier you
have already accepted, and keep each one at least ttl + DESYNC_TOLERANCE seconds.
Gets the XML token.
Indicates whether the certificate of the token is out of date (true without certificate).
Indicates whether the signing certificate is trusted, according to the trust anchor of the analysis; null if it could not be evaluated.
Indicates whether the token data are encrypted; null if it could not be evaluated.
Indicates whether the digest of the token has been verified and is valid; null if it could not be evaluated.
Indicates whether the token is out of date: its timestamp is more than
ttl seconds in the past, or more than DESYNC_TOLERANCE seconds in
the future, or it has no valid timestamp, or its expiry, if any, is
passed (or could not be read).
The time to live (in seconds) allowed for the token.
Indicates whether the XML token is valid: no error and no anomaly, the
digest and the signature verified, the signing certificate trusted
(see isCertTrusted()), and the token addressed to the expected
audience. Without a trust anchor given to the analysis, it returns
false.
It checks neither the freshness of the token nor whether it is
replayed: see isOutOfDate() and getTokenId().
Indicates whether the signature of the digest has been verified and is valid; null if it could not be evaluated.
Checks that the certificate of the token was issued by the given CA
certificate (only this link: see X509Cert.isValidCA()).
isSignatureValid() verifies the whole chain against the trust anchor.
The CA certificate, in PEM format: the path of its file, or its content.
Checks that the issuer of the certificate of the token has the given
fields. This only compares names, which any certificate can copy:
isSignatureValid() verifies the certificate against the trust anchor.
The fields the issuer must have, e.g.
{ O: 'Lothbrok Ltd', OU: 'Shield Wall Dept' }.
StaticanalyzeAnalyzes an XML token whose data are encrypted, with the private key of the recipient. An unencrypted token can also be analyzed this way.
The token is only decrypted once its structure, its algorithms, its
digest, its signature and the trust in its certificate have been
verified, and every failure of the decryption gives the same error,
Token decryption failed!.
The XML token, as a string or as the bytes of its UTF-8 encoding.
The private key of the recipient, in PEM format: the path of its file, or its content.
The password of this key, if any.
The options, trust anchor included (see the README).
StaticanalyzeAnalyzes an XML token.
The options must hold a trust anchor, caCertPath and/or
signerCertPath; without it, isSignatureValid() returns false. If
the token is not valid, getError() tells why; an option that is
refused throws.
The XML token, as a string or as the bytes of its UTF-8 encoding.
The options, trust anchor included (see the README).
StaticcreateCreates a signed token whose data are encrypted for the owner of the
encryption certificate: only the private key of this certificate
decrypts them. The sender does not need this private key: pass null as
cryptKeyPath.
The created token is checked right away. Without cryptKeyPath, the
check covers everything that can be verified without decrypting the
token (structure, algorithms, digest, signature, trust in the signing
certificate): isSignatureValid() and isDataEncrypted() return true,
while getData(), getTimestamp(), getTokenId(), getAudience()
and getExpiry() return null. With cryptKeyPath, the token is also
decrypted and its content read.
The token data (see createXMLToken()).
The private key that signs the token, in PEM format.
The X.509 certificate of this key, in PEM format.
The private key of the recipient, in PEM format, to check the content of the created token; null without it.
The encryption certificate of the recipient, in PEM format.
The password of the signing key, if any.
The password of the private key of the
recipient, if any (null without cryptKeyPath).
The options (see the README).
StaticcreateCreates an XML token for the given user data.
The created token is analyzed right away to check it, with the
certificate of its own signing key as trust anchor. If it cannot be
created, getError() tells why; a parameter or an option that is
refused throws.
The token data: named values, nested at will. A value is a string, a number, a boolean, null (written as an empty string), or bytes (a Uint8Array).
The private key that signs the token, in PEM format: the path of its file, or its content.
The X.509 certificate of this key, in PEM format, included in the token: the path of its file, or its content.
The password of the private key, if any.
The options (see the README).
An XML token: an enveloping XML digital signature that holds timestamped user data, optionally encrypted. The counterpart of the class
XMLDSigTokenof the PHP library ezxmldsig: both create and verify the same tokens.Get an instance with one of the factories,
createXMLToken()to create a token,analyzeXMLToken()to analyze one. An analysis requires a trust anchor (optionscaCertPathand/orsignerCertPath): without it, no token is valid.isSignatureValid()checks neither the freshness of the token nor whether it is replayed. Before trusting the data of a received token, the receiver must check thatisSignatureValid()returns true, thatisOutOfDate(ttl)returns false, and that the identifier returned bygetTokenId()has not been accepted before (store it atomically, and refuse the token if it already is).