2020-06-04 07:09:48 +00:00
|
|
|
namespace chestcrypto.identity
|
|
|
|
{
|
|
|
|
|
|
|
|
public class PublicIdentity{
|
|
|
|
/*
|
|
|
|
PublicIdentity is a wrapper around a DoublePublicKey providing associated metadata such as alias and note
|
|
|
|
*/
|
|
|
|
private DoublePublicKey key;
|
2020-06-08 07:59:43 +00:00
|
|
|
public string base85Key { get {
|
|
|
|
return getEncodedKey();
|
|
|
|
}}
|
|
|
|
public string name { get; set; }
|
|
|
|
public string comment { get; set; } // human's note
|
2020-06-04 07:09:48 +00:00
|
|
|
|
2020-06-05 04:16:05 +00:00
|
|
|
public PublicIdentity(DoublePublicKey doublePublicKey, string alias){
|
|
|
|
key = doublePublicKey;
|
2020-06-04 07:09:48 +00:00
|
|
|
name = alias;
|
|
|
|
comment = "";
|
|
|
|
}
|
|
|
|
|
2020-06-05 04:16:05 +00:00
|
|
|
public PublicIdentity(DoublePublicKey doublePublicKey, string alias, string note){
|
|
|
|
key = doublePublicKey;
|
2020-06-04 07:09:48 +00:00
|
|
|
name = alias;
|
|
|
|
comment = note;
|
|
|
|
}
|
|
|
|
|
2020-06-04 08:32:23 +00:00
|
|
|
public DoublePublicKey getPublicKey(){return key;}
|
2020-06-04 07:09:48 +00:00
|
|
|
public string getName(){return name;}
|
|
|
|
public string getNote(){return comment;}
|
2020-06-08 07:59:43 +00:00
|
|
|
public string getEncodedKey(){
|
|
|
|
return SimpleBase.Base85.Z85.Encode(key.getRawDouble());
|
|
|
|
}
|
2020-06-04 07:09:48 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|