Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ResponseHeader,
RequestHeader,
SignatureData,
MessageSecurityMode,
_enumerationMessageSecurityMode,
UserTokenPolicy
} from "node-opcua-types";
export { AsymmetricAlgorithmSecurityHeader } from "./AsymmetricAlgorithmSecurityHeader";
export { SymmetricAlgorithmSecurityHeader } from "./SymmetricAlgorithmSecurityHeader";
export * from "./message_security_mode";
// createdAt
ChannelSecurityToken.schema.fields[2].defaultValue = () => new Date();
// revisedLifetime
ChannelSecurityToken.schema.fields[3].defaultValue = () => 30000;
export function hasTokenExpired(token: ChannelSecurityToken): boolean {
return (token.createdAt !== null)
&& (token.createdAt.getTime() + token.revisedLifetime) < Date.now();
}
Object.defineProperty(ChannelSecurityToken.prototype, "expired", {
get() { return hasTokenExpired(this as ChannelSecurityToken); },
configurable: true,
enumerable: true,
});
// ErrorMessage
// "Error", "UInt32","The numeric code for the error. This shall be one of the values listed in Table 40."
// "Reason","String", "A more verbose description of the error.This string shall not be more than 4096 characters."
SecurityTokenRequestType,
ResponseHeader,
RequestHeader,
SignatureData,
MessageSecurityMode,
_enumerationMessageSecurityMode,
UserTokenPolicy
} from "node-opcua-types";
export { AsymmetricAlgorithmSecurityHeader } from "./AsymmetricAlgorithmSecurityHeader";
export { SymmetricAlgorithmSecurityHeader } from "./SymmetricAlgorithmSecurityHeader";
export * from "./message_security_mode";
// createdAt
ChannelSecurityToken.schema.fields[2].defaultValue = () => new Date();
// revisedLifetime
ChannelSecurityToken.schema.fields[3].defaultValue = () => 30000;
export function hasTokenExpired(token: ChannelSecurityToken): boolean {
return (token.createdAt !== null)
&& (token.createdAt.getTime() + token.revisedLifetime) < Date.now();
}
Object.defineProperty(ChannelSecurityToken.prototype, "expired", {
get() { return hasTokenExpired(this as ChannelSecurityToken); },
configurable: true,
enumerable: true,
});
// ErrorMessage