buildRSAPublicKeyPacket static method
Implementation
@visibleForTesting
static Uint8List buildRSAPublicKeyPacket(
List<int> modulus, List<int> exponent,
[@visibleForTesting int? timestamp, @visibleForTesting int? type]) {
final List<int> encoded =
_timestampAndVersion(0x04, timestamp) + _mpi(modulus) + _mpi(exponent);
type ??= encoded.length >> 8 == 0 ? 0x98 : 0x99;
return Uint8List.fromList(
[type] + (type == 0x99 ? _mpi(encoded) : [encoded.length] + encoded));
}