public static byte[] GetNameSKeySubject(string name, string subject) { var nameBytes = KeyConfig.GetBytes(name); var z = KeyConfig.ByteZero; var sBytes = KeyConfig.GetBytes(subject); return(KeyConfig.ConcatBytes(nameBytes, KeyConfig.ByteS, z, sBytes)); }
public static byte[] GetNamePKeyPredicate(string name, string predicate) { var nameBytes = KeyConfig.GetBytes(name); var z = KeyConfig.ByteZero; var pBytes = KeyConfig.GetBytes(predicate); return(KeyConfig.ConcatBytes(nameBytes, KeyConfig.ByteP, z, pBytes)); }
public static byte[] GetNameOKeyObject(string name, TripleObject o) { var nameBytes = KeyConfig.GetBytes(name); var z = KeyConfig.ByteZero; var oBytes = KeyConfig.GetBytes(o.ToValue()); var isIdBytes = o.IsID ? KeyConfig.ByteTrue : KeyConfig.ByteFalse; return(KeyConfig.ConcatBytes(nameBytes, KeyConfig.ByteO, z, isIdBytes, z, oBytes)); }
public KeySegments(string name, string s, string p, TripleObject o) { _name = KeyConfig.GetBytes(name); S = KeyConfig.GetBytes(s); P = KeyConfig.GetBytes(p); O = KeyConfig.GetBytes(o.ToValue()); IsId = o.IsID ? KeyConfig.ByteTrue : KeyConfig.ByteFalse; Index = BitConverter.GetBytes(o.Index); }
public static byte[] ToBytes(this TripleObject o) { var oBytes = KeyConfig.GetBytes(o.ToValue()); var isIdBytes = o.IsID ? KeyConfig.ByteTrue : KeyConfig.ByteFalse; var typeBytes = KeyConfig.GetBytes((int)o.TokenType); // index is not converted return(KeyConfig.ConcatBytes(isIdBytes, typeBytes, oBytes)); }
public static byte[] GetNameSKeySubjectPredicateIndex(string name, string subject, string predicate, int index) { var nameBytes = KeyConfig.GetBytes(name); var z = KeyConfig.ByteZero; var sBytes = KeyConfig.GetBytes(subject); var pBytes = KeyConfig.GetBytes(predicate); var indexBytes = BitConverter.GetBytes(index); return(KeyConfig.ConcatBytes(nameBytes, KeyConfig.ByteS, z, sBytes, z, pBytes, z, indexBytes)); }
public static byte[] GetNameSKey(string name) { return(KeyConfig.ConcatBytes(KeyConfig.GetBytes(name), KeyConfig.ByteS)); }
public static byte[] GetNamePPredicate(string name) { var nameBytes = KeyConfig.GetBytes(name); return(KeyConfig.ConcatBytes(nameBytes, KeyConfig.ByteP)); }
private byte[] Hash(string input) { return(KeyConfig.GetBytes(input)); }