ed25519 static method

Future<LocalSigning> ed25519(
  1. List<int> pkcs8Bytes
)

Implementation

static Future<LocalSigning> ed25519(List<int> pkcs8Bytes) async {
  if (!ListEquality().equals(
    pkcs8Bytes.sublist(0, ed25519Asn1Prefix.length),
    ed25519Asn1Prefix,
  )) {
    throw Exception('invalid Ed25519 PKCS #8 ASN.1 DER prefix');
  }
  final bytes = pkcs8Bytes.sublist(
    ed25519Asn1Prefix.length,
    ed25519Asn1Prefix.length + ed25519Length,
  );
  return LocalSigning(await Ed25519().newKeyPairFromSeed(bytes));
}