2018-04-09 21:50:36 +00:00
|
|
|
<form {{action 'doSubmit' (hash input=input hash_algorithm=hash_algorithm key_version=key_version) on="submit"}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
{{#if hmac}}
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
<div class="field">
|
|
|
|
<label for="hmac" class="is-label">HMAC</label>
|
|
|
|
<div class="control">
|
|
|
|
<textarea readonly class="textarea" id="hmac">{{hmac}}</textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field is-grouped box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
|
|
|
{{#copy-button
|
|
|
|
clipboardTarget="#hmac"
|
|
|
|
class="button is-primary"
|
|
|
|
buttonType="button"
|
|
|
|
success=(action (set-flash-message 'HMAC copied!'))
|
|
|
|
}}
|
|
|
|
Copy
|
|
|
|
{{/copy-button}}
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button {{action 'onClear'}} type="button" class="button">
|
|
|
|
Back
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
{{key-version-select
|
|
|
|
key=key
|
|
|
|
onVersionChange=(action (mut key_version))
|
|
|
|
key_version=key_version
|
|
|
|
}}
|
|
|
|
<div class="field">
|
|
|
|
<label for="input" class="is-label">
|
|
|
|
Input
|
|
|
|
</label>
|
|
|
|
<div class="control is-relative">
|
|
|
|
{{textarea id="input" name="input" value=input class="textarea" data-test-transit-input="input"}}
|
|
|
|
{{b64-toggle value=input isInput=false data-test-transit-b64-toggle="input"}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2018-04-09 21:50:36 +00:00
|
|
|
<label for="hash_algorithm" class="is-label">Hash Algorithm</label>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="control is-expanded">
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
<select
|
2018-04-09 21:50:36 +00:00
|
|
|
name="hash_algorithm"
|
|
|
|
id="hash_algorithm"
|
|
|
|
onchange={{action (mut hash_algorithm) value="target.value"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
>
|
|
|
|
{{#each (sha2-digest-sizes) as |algo|}}
|
2018-04-09 21:50:36 +00:00
|
|
|
<option selected={{if hash_algorithm (eq hash_algorithm algo)}} value={{algo}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
<code>{{algo}}</code>
|
|
|
|
</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field is-grouped box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary">
|
|
|
|
HMAC
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</form>
|