Skip to content
Snippets Groups Projects
CryptoData.js 1.24 KiB
Newer Older
  • Learn to ignore specific revisions
  • function CryptoData() {}
    
    CryptoData.prototype.set = function(obj) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      for (var member in obj) {
        this[member] = JSON.parse(JSON.stringify(obj[member]));
    
      }
    };
    
    CryptoData.prototype.serialize = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return JSON.stringify(this);
    
    };
    
    CryptoData.prototype.deserialize = function(serialized) {
      var obj = JSON.parse(serialized);
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this.set(obj);
    
    };
    
    CryptoData.prototype.setPublicKey = function(publicKey) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this["publicKey"] = publicKey;
    
    };
    
    CryptoData.prototype.getPublicKey = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return this["publicKey"];
    
    };
    
    CryptoData.prototype.setPrivateKey = function(privateKey) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this["privateKey"] = privateKey;
    
    };
    
    CryptoData.prototype.getPrivateKey = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return this["privateKey"];
    
    };
    
    CryptoData.prototype.setx509Certificate = function(x509Certificate) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this["x509Certificate"] = x509Certificate;
    
    };
    
    CryptoData.prototype.getx509Certificate = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return this["x509Certificate"];
    
    };
    
    CryptoData.prototype.setKeyUUID = function(keyUUID) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this["keyUUID"] = keyUUID;
    
    };
    
    CryptoData.prototype.getKeyUUID = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return this["keyUUID"];
    
    };
    
    CryptoData.prototype.setChain = function(chain) {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      this["chain"] = chain;
    
    };
    
    CryptoData.prototype.getChain = function() {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      return this["chain"];
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    export default CryptoData;