stringToSignature function

IKey stringToSignature(
  1. String s
)

Convert key in s to binary form */

Implementation

IKey stringToSignature(String s) {
  if (s.substring(0, 7) == 'SIG_K1_') {
    return stringToKey(s.substring(7), KeyType.k1, signatureDataSize, 'K1');
  } else if (s.substring(0, 7) == 'SIG_R1_') {
    return stringToKey(s.substring(7), KeyType.r1, signatureDataSize, 'R1');
  } else {
    throw 'unrecognized signature format';
  }
}