SignedBytes.create constructor

SignedBytes.create(
  1. PublicKey publicKey,
  2. ByteData content,
  3. Signature signature
)

Implementation

factory SignedBytes.create(
  PublicKey publicKey,
  ByteData content,
  Signature signature,
) {
  final nativeData = ByteSlice.fromBytes(content);
  try {
    final nativeSignedBytes = DartApi.native.signedBytes
        .create(publicKey.ffi, nativeData.addressOf, signature.ffi);
    return SignedBytes(nativeSignedBytes, true);
  } finally {
    nativeData.dispose();
  }
}