added signature validity display to web ui mail
parent
bec8ecdc12
commit
06048fe442
|
@ -498,6 +498,12 @@ class API:
|
|||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
validSig = False
|
||||
signer = self._core._utils.bytesToStr(bl.signer)
|
||||
print(signer, bl.isSigned(), self._core._utils.validatePubKey(signer), bl.isSigner(signer))
|
||||
if bl.isSigned() and self._core._utils.validatePubKey(signer) and bl.isSigner(signer):
|
||||
validSig = True
|
||||
bl.bheader['validSig'] = validSig
|
||||
bl.bheader['meta'] = ''
|
||||
retData = {'meta': bl.bheader, 'metadata': bl.bmetadata}
|
||||
return json.dumps(retData)
|
||||
|
|
|
@ -27,8 +27,10 @@
|
|||
<div id='messageDisplay' class='overlay'>
|
||||
<div class='overlayContent'>
|
||||
<span class='closeOverlay' overlay='messageDisplay'></span>
|
||||
<div>From: <input type='text' id='fromUser' readonly>
|
||||
<div>
|
||||
From: <input type='text' id='fromUser' readonly>
|
||||
</div>
|
||||
<div id='signatureValidity'></div>
|
||||
<div id='threadDisplay'>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -63,10 +63,22 @@ function loadInboxEntrys(bHash){
|
|||
var senderInput = document.createElement('input')
|
||||
var subjectLine = document.createElement('span')
|
||||
var dateStr = document.createElement('span')
|
||||
var validSig = document.createElement('span')
|
||||
var humanDate = new Date(0)
|
||||
var metadata = resp['metadata']
|
||||
humanDate.setUTCSeconds(resp['meta']['time'])
|
||||
senderInput.value = httpGet('/getHumanReadable/' + resp['meta']['signer'])
|
||||
alert(resp['meta']['validSig'])
|
||||
if (resp['meta']['validSig']){
|
||||
validSig.innerText = 'Signature Validity: Good'
|
||||
}
|
||||
else{
|
||||
validSig.innerText = 'Signature Validity: Bad'
|
||||
validSig.style.color = 'red';
|
||||
}
|
||||
if (senderInput.value == ''){
|
||||
senderInput.value = 'Anonymous'
|
||||
}
|
||||
bHashDisplay.innerText = bHash.substring(0, 10)
|
||||
entry.setAttribute('hash', bHash);
|
||||
senderInput.readOnly = true
|
||||
|
@ -81,6 +93,7 @@ function loadInboxEntrys(bHash){
|
|||
threadPart.appendChild(entry)
|
||||
entry.appendChild(bHashDisplay)
|
||||
entry.appendChild(senderInput)
|
||||
entry.appendChild(validSig)
|
||||
entry.appendChild(subjectLine)
|
||||
entry.appendChild(dateStr)
|
||||
entry.classList.add('threadEntry')
|
||||
|
|
Loading…
Reference in New Issue