SecurityDetails.fromJson constructor
SecurityDetails.fromJson(
- Map<String, dynamic> json
)
Implementation
factory SecurityDetails.fromJson(Map<String, dynamic> json) {
return SecurityDetails(
protocol: json['protocol'] as String,
keyExchange: json['keyExchange'] as String,
keyExchangeGroup:
json.containsKey('keyExchangeGroup')
? json['keyExchangeGroup'] as String
: null,
cipher: json['cipher'] as String,
mac: json.containsKey('mac') ? json['mac'] as String : null,
certificateId: security.CertificateId.fromJson(
json['certificateId'] as int,
),
subjectName: json['subjectName'] as String,
sanList: (json['sanList'] as List).map((e) => e as String).toList(),
issuer: json['issuer'] as String,
validFrom: TimeSinceEpoch.fromJson(json['validFrom'] as num),
validTo: TimeSinceEpoch.fromJson(json['validTo'] as num),
signedCertificateTimestampList:
(json['signedCertificateTimestampList'] as List)
.map(
(e) => SignedCertificateTimestamp.fromJson(
e as Map<String, dynamic>,
),
)
.toList(),
certificateTransparencyCompliance:
CertificateTransparencyCompliance.fromJson(
json['certificateTransparencyCompliance'] as String,
),
serverSignatureAlgorithm:
json.containsKey('serverSignatureAlgorithm')
? json['serverSignatureAlgorithm'] as int
: null,
encryptedClientHello: json['encryptedClientHello'] as bool? ?? false,
);
}