aboutsummaryrefslogtreecommitdiff
path: root/keys.go
diff options
context:
space:
mode:
Diffstat (limited to 'keys.go')
-rw-r--r--keys.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/keys.go b/keys.go
index b48302e..987f6b6 100644
--- a/keys.go
+++ b/keys.go
@@ -46,7 +46,21 @@ func (v *EncKey) XOR(key []byte) {
}
}
+func (v *Sig) IsValid() bool {
+ return v.PKAlg == PKAlg
+}
+
+func (v *PubKey) IsValid() bool {
+ return v.PKAlg == PKAlg
+}
+
func (v *EncKey) IsValid(pass []byte) bool {
+ if v.PKAlg != PKAlg {
+ return false
+ }
+ if v.KDFAlg != KDFAlg {
+ return false
+ }
if v.KDFRounds > 0 {
key := bhash.Pbkdf(pass, v.Salt[:], int(v.KDFRounds), len(v.SecKey))
v.XOR(key)