pgp_code.gohtml (3706B)
1 {{ define "navbar" }} {{ end }} 2 3 {{ define "content" }} 4 5 <div class="container"> 6 <div class="row"> 7 <div class="col-8 offset-2 col-md-8 offset-md-2 col-sm-8 col-lg-6 offset-lg-3 col-xl-6 offset-xl-3"> 8 {{ if .Data.Error }} 9 <div class="alert alert-danger">{{ .Data.Error }}</div> 10 {{ end }} 11 <div class="card mb-3"> 12 <div class="card-header"> 13 {{ t "PGP public key (step 2)" . }} 14 </div> 15 <div class="card-body"> 16 <form method="post" novalidate> 17 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 18 <input type="hidden" name="pgp_public_key" value="{{ .Data.PGPPublicKey }}" /> 19 <input type="hidden" name="formName" value="pgp_step2" /> 20 <input type="hidden" name="gpg_mode" value="{{ .Data.GpgMode }}" /> 21 {{ if .Data.GpgMode }} 22 <div class="form-group"> 23 <label for="encrypted_message">{{ t "Please sign the following message with your private key and send the signature" . }}</label> 24 <p><code>gpg --armor --detach-sign file</code></p> 25 <pre class="code-select"><code>{{ .Data.ToBeSignedMessage }}</code></pre> 26 <input name="to_be_signed_message" value="{{ .Data.ToBeSignedMessage }}" type="hidden" /> 27 </div> 28 <div class="form-group"> 29 <label for="signed_message">{{ t "Message detached signature" . }}</label> 30 <textarea name="signed_message" id="signed_message" rows="10" class="form-control mono{{ if .Data.ErrorSignedMessage }} is-invalid{{ end }}" autofocus>{{ .Data.SignedMessage }}</textarea> 31 {{ if .Data.ErrorSignedMessage }} 32 <div class="invalid-feedback">{{ .Data.ErrorSignedMessage }}</div> 33 {{ end }} 34 </div> 35 {{ else }} 36 <div class="form-group"> 37 <label for="encrypted_message">{{ t "Please decrypt the following message with your private key and send the required code" . }}</label> 38 <input name="encrypted_message" value="{{ .Data.EncryptedMessage }}" type="hidden" /> 39 <pre class="code-select"><code>{{ .Data.EncryptedMessage }}</code></pre> 40 </div> 41 <div class="form-group"> 42 <label for="pgp_code">{{ t "Your decrypted code" . }}</label> 43 <input name="pgp_code" id="pgp_code" value="{{ .Data.Code }}" type="text" class="form-control{{ if .Data.ErrorCode }} is-invalid{{ end }}" autofocus /> 44 {{ if .Data.ErrorCode }} 45 <div class="invalid-feedback">{{ .Data.ErrorCode }}</div> 46 {{ end }} 47 </div> 48 {{ end }} 49 <div class="form-group"> 50 <input type="submit" value="{{ t "Validate PGP public key" . }}" class="btn btn-primary" /> 51 <a href="/settings/pgp" class="btn btn-secondary">{{ t "Cancel" . }}</a> 52 </div> 53 </form> 54 </div> 55 </div> 56 </div> 57 </div> 58 </div> 59 60 {{ end }}