derDecode static method

BinaryBlob derDecode(
  1. BinaryBlob key
)

Implementation

static BinaryBlob derDecode(BinaryBlob key) {
  final unwrapped = bytesUnwrapDer(key, oidEd25519);
  if (unwrapped.length != rawKeyLength) {
    throw RangeError.value(
      unwrapped.length,
      'Expected $rawKeyLength-bytes long '
      'but got ${unwrapped.length}',
    );
  }
  return unwrapped;
}