Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function securityPolicyLevel(securityPolicy: UAString): number {
switch (securityPolicy) {
case SecurityPolicy.None:
return 0;
case SecurityPolicy.Basic128:
return 0;
case SecurityPolicy.Basic128Rsa15:
return 0;
case SecurityPolicy.Basic192:
return 1;
case SecurityPolicy.Basic192Rsa15:
return 2;
case SecurityPolicy.Basic256:
return 3;
case SecurityPolicy.Basic256Rsa15:
return 3;
case SecurityPolicy.Basic256Sha256:
return 3;
default:
return 0;
}
}
function securityPolicyLevel(securityPolicy) {
switch (securityPolicy) {
case SecurityPolicy.None:
return 0;
case SecurityPolicy.Basic128:
return 0;
case SecurityPolicy.Basic128Rsa15:
return 0;
case SecurityPolicy.Basic192:
return 1;
case SecurityPolicy.Basic192Rsa15:
return 2;
case SecurityPolicy.Basic256:
return 3;
case SecurityPolicy.Basic256Rsa15:
return 3;
case SecurityPolicy.Basic256Sha256:
return 3;
default:
return 0;
}
}