public override PACSAMKeyRecord Clone(bool includeKey = false) { PACSAMAES128KeyRecord instance = new PACSAMAES128KeyRecord(); CopyTo(instance, includeKey); return(instance); }
public override void ExportParts(params PACSAMKeyRecord[] parts) { // There must be at least 3 or more parts if (parts.Length < 3) { throw new ArgumentException(@"ExportParts: There must be at 3 or more parts to export to!"); } // Create part 0 parts[0] = new PACSAMAES128KeyRecord(this); // Iterate through the parts from 1 to n (skipping the first, which will hold the XOR result) for (int i = 1; i < parts.Length; i++) { // Generate the part parts[i] = new PACSAMAES128KeyRecord(this); var pI = (parts[i] as PACSAMAES128KeyRecord); var p0 = (parts[0] as PACSAMAES128KeyRecord); pI.Value = Crypto.CreateRandomEntropy(Value.Length); p0.Value = Crypto.XorArray(p0.Value, pI.Value); } }
public PACSAMAES128KeyRecord(PACSAMAES128KeyRecord copyObject) { copyObject.CopyTo(this, true); }