node-red-contrib-trustpoint
Version:
Node-RED nodes for EST (Enrollment over Secure Transport) and certificate operations.
91 lines (78 loc) • 3.12 kB
HTML
<script type="text/html" data-template-name="trustpoint-create-csr">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Node name">
</div>
<div class="form-row">
<label for="node-input-privateKey"><i class="fa fa-key"></i> Private Key (PEM)</label>
<input type="text" id="node-input-privateKey" placeholder="msg.payload.privateKey or inline PEM">
<input type="hidden" id="node-input-privateKey_fieldType">
</div>
<div class="form-row">
<label for="node-input-cn"><i class="fa fa-user-circle"></i> Common Name (CN)</label>
<input type="text" id="node-input-cn" placeholder="example.com">
</div>
<div class="form-row">
<label for="node-input-o"><i class="fa fa-building-o"></i> Organization (O)</label>
<input type="text" id="node-input-o" placeholder="Organization (optional)">
</div>
<div class="form-row">
<label for="node-input-ou"><i class="fa fa-sitemap"></i> Organizational Unit (OU)</label>
<input type="text" id="node-input-ou" placeholder="Unit (optional)">
</div>
<div class="form-row">
<label for="node-input-san"><i class="fa fa-globe"></i> Subject Alt Names (SAN)</label>
<input type="text" id="node-input-san" placeholder="Comma-separated: domain.com, 1.2.3.4">
</div>
<div id="csr-info" class="validation-result">
<div class="validation-box" id="csr-info-box">
This node generates a Certificate Signing Request (CSR) from a private key and subject info.
</div>
</div>
</script>
<style>
.validation-box {
padding: 10px;
border-radius: 5px;
margin-top: 10px;
font-weight: normal;
}
.validation-info {
background-color: #4cafaf;
color: white;
}
</style>
<script type="text/javascript">
(function () {
RED.nodes.registerType('trustpoint-create-csr', {
category: 'Trustpoint',
color: '#3e91f7',
defaults: {
name: { value: "" },
privateKey: { value: "" },
privateKey_fieldType: { value: "str" },
cn: { value: "" },
o: { value: "" },
ou: { value: "" },
san: { value: "" }
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-certificate",
label: function () {
return this.name || "trustpoint-create-csr";
},
labelStyle: function () {
return this.name ? "node_label_italic" : "";
},
oneditprepare: function () {
$("#node-input-privateKey").typedInput({
default: 'str',
types: ['str', 'msg', 'flow', 'global'],
typeField: $("#node-input-privateKey_fieldType")
});
$("#csr-info-box").addClass("validation-info");
}
});
})();
</script>