mirror of
https://github.com/gchq/CyberChef
synced 2025-12-17 08:43:43 +00:00
ESM: Ported PublicKey operations
This commit is contained in:
40
src/core/operations/ObjectIdentifierToHex.mjs
Normal file
40
src/core/operations/ObjectIdentifierToHex.mjs
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2016
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import r from "jsrsasign";
|
||||
import Operation from "../Operation";
|
||||
|
||||
/**
|
||||
* Object Identifier to Hex operation
|
||||
*/
|
||||
class ObjectIdentifierToHex extends Operation {
|
||||
|
||||
/**
|
||||
* ObjectIdentifierToHex constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "Object Identifier to Hex";
|
||||
this.module = "PublicKey";
|
||||
this.description = "Converts an object identifier (OID) into a hexadecimal string.";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @param {Object[]} args
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
return r.KJUR.asn1.ASN1Util.oidIntToHex(input);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ObjectIdentifierToHex;
|
||||
Reference in New Issue
Block a user