/// RSA 金鑰對實體
/// 代表用戶的公鑰/私鑰對
class RsaKeyPair {
  final String publicKey;
  final String privateKey;

  const RsaKeyPair({
    required this.publicKey,
    required this.privateKey,
  });

  /// 檢查金鑰對是否有效
  bool get isValid => publicKey.isNotEmpty && privateKey.isNotEmpty;

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is RsaKeyPair &&
        other.publicKey == publicKey &&
        other.privateKey == privateKey;
  }

  @override
  int get hashCode => Object.hash(publicKey, privateKey);
}

