2018-04-03 14:16:57 +00:00
|
|
|
<form {{action 'doSubmit' (hash ciphertext=ciphertext context=context nonce=nonce) on="submit"}}>
|
2020-03-16 22:48:11 +00:00
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
<div class="content">
|
|
|
|
<p>You can decrypt ciphertext using <code>{{key.name}}</code> as the encryption key.</p>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
<div class="field">
|
|
|
|
<label for="ciphertext" class="is-label">Ciphertext</label>
|
|
|
|
<div id="ciphertext-control" class="control">
|
|
|
|
{{ivy-codemirror
|
|
|
|
valueUpdated=(action (mut ciphertext))
|
|
|
|
options=(hash
|
|
|
|
lineNumbers=true
|
|
|
|
tabSize=2
|
|
|
|
mode='ruby'
|
|
|
|
theme='hashi'
|
|
|
|
)
|
|
|
|
data-test-transit-input="ciphertext"
|
2018-04-03 14:16:57 +00:00
|
|
|
}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
{{#if key.derived}}
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="field">
|
2020-03-16 22:48:11 +00:00
|
|
|
<label for="context" class="is-label">
|
|
|
|
Context
|
|
|
|
</label>
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
|
|
|
{{input type="text" id="context" value=context class="input" data-test-transit-input="context"}}
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
{{b64-toggle value=context data-test-transit-b64-toggle="context"}}
|
|
|
|
</div>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
{{/if}}
|
|
|
|
{{#if (eq key.convergentEncryptionVersion 1)}}
|
|
|
|
<div class="field">
|
|
|
|
<label for="nonce" class="is-label">Nonce</label>
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
|
|
|
{{input type="text" id="nonce" value=nonce class="input" data-test-transit-input="nonce"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
<div class="control">
|
|
|
|
{{b64-toggle value=nonce data-test-transit-b64-toggle="nonce"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
<div class="field is-grouped box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary" id="decrypt" data-test-button-decrypt>
|
|
|
|
Decrypt
|
|
|
|
</button>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
2020-03-16 22:48:11 +00:00
|
|
|
</div>
|
2018-04-03 14:16:57 +00:00
|
|
|
</form>
|
2020-03-16 22:48:11 +00:00
|
|
|
{{#if isModalActive}}
|
|
|
|
<Modal @title="Copy your unwrapped data" @onClose={{action (mut isModalActive) false}} @isActive={{isModalActive}}>
|
|
|
|
<section class="modal-card-body">
|
|
|
|
<div class="box is-shadowless is-fullwidth is-sideless">
|
|
|
|
<h2 class="title is-6">Plaintext</h2>
|
|
|
|
<div class="copy-text level">
|
|
|
|
<code class="level-left" data-test-encrypted-value="plaintext">{{plaintext}}</code>
|
|
|
|
<CopyButton class="button is-compact is-transparent level-right" data-test-button="modal-copy" @clipboardText={{plaintext}}
|
|
|
|
@buttonType="button" @success={{action (set-flash-message 'Plaintext copied!')}}>
|
|
|
|
<Icon @glyph="copy-action" aria-label="Copy" />
|
|
|
|
</CopyButton>
|
|
|
|
</div>
|
|
|
|
<p class="help">Plaintext is base64 encoded</p>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<CopyButton class="button is-primary copy-close" data-test-button="modal-copy-close" @clipboardText={{plaintext}}
|
|
|
|
@buttonType="button" @success={{action "toggleModal" "Plaintext copied!"}}>
|
|
|
|
Copy & Close
|
|
|
|
</CopyButton>
|
|
|
|
</footer>
|
|
|
|
</Modal>
|
|
|
|
{{/if}}
|