dvAndroidSealKeyBlob function

String dvAndroidSealKeyBlob(
  1. Uint8List nonce,
  2. Uint8List sealed
)

The text kept on disk for a key sealed as sealed under nonce.

Refuses anything that is not a nonce and a sealed key. A 32-byte sealed is an application key with no tag on it -- the key itself -- and a store that tried to write one would otherwise put it in a file.

Implementation

String dvAndroidSealKeyBlob(Uint8List nonce, Uint8List sealed) {
  if (nonce.length != dvAndroidKeystoreNonceBytes) {
    throw ArgumentError.value(nonce.length, 'nonce', 'a GCM nonce is $dvAndroidKeystoreNonceBytes bytes');
  }
  if (sealed.length != dvAndroidSealedKeyBytes) {
    throw ArgumentError.value(sealed.length, 'sealed',
        'a sealed application key is $dvAndroidSealedKeyBytes bytes (key and tag)');
  }
  return '$_blobPrefix${base64Encode(<int>[...nonce, ...sealed])}';
}