aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/key.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/key.go')
-rw-r--r--crypto/key.go23
1 files changed, 19 insertions, 4 deletions
diff --git a/crypto/key.go b/crypto/key.go
index 5e1f3637e..067a5a294 100644
--- a/crypto/key.go
+++ b/crypto/key.go
@@ -48,17 +48,32 @@ type plainKeyJSON struct {
PrivateKey []byte
}
+type encryptedKeyJSON struct {
+ Id []byte
+ Address []byte
+ Crypto cipherJSON
+}
+
type cipherJSON struct {
MAC []byte
Salt []byte
IV []byte
+ KeyHeader keyHeaderJSON
CipherText []byte
}
-type encryptedKeyJSON struct {
- Id []byte
- Address []byte
- Crypto cipherJSON
+type keyHeaderJSON struct {
+ Version string
+ Kdf string
+ KdfParams scryptParamsJSON // TODO: make more generic?
+}
+
+type scryptParamsJSON struct {
+ N int
+ R int
+ P int
+ DkLen int
+ SaltLen int
}
func (k *Key) MarshalJSON() (j []byte, err error) {