name property Null safety

String name

Get the readable name of this OI

Implementation

String get name {
  if (readableName != null) {
    return readableName!;
  }

  const names = <String, String>{
    Pkcs.emailAddress: 'emailAddress',
    Pkcs.signedData: 'signedData',
    Pkcs.netscapeComment: 'netscape-comment',
    Pkcs.sha1: 'sha1',
    Pkcs.contentType: 'contentType',
    Pkcs.signingTime: 'signingTime',
    Pkcs.messageDigest: 'messageDigest',
    Pkcs.smimeCapabilities: 'smimeCapabilities',
    Pkcs.data: 'data',
    Pkcs.sha256Nist: 'sha256',
    Pkcs.sha384: 'sha384',
    Pkcs.sha512: 'sha512',
    Pkcs.timestamp: 'timestamp',
    Pkcs.organizationIdentifier: 'organizationIdentifier',
  };

  if (names[objectIdentifierAsString] == null) {
    print('OI not found: $objectIdentifierAsString');
  }

  return names[objectIdentifierAsString] ??
      objectIdentifierAsString ??
      '(unknown)';
}