# getSubjectOrganizationalUnit method

String getSubjectOrganizationalUnit()

Gets the the organizational unit (OU) of the certificate subject.

return The organizational unit (OU) of the certificate subject. throws BiosealException An error has occurred during Bioseal Library execution.

## Implementation

    String getSubjectOrganizationalUnit() {
      Pointer<Char> pSubjectOrganizationalUnit = nullptr;
      Pointer<Int> pSubjectOrganizationalUnitSize = calloc.allocate(1);
      pSubjectOrganizationalUnitSize[0] = -1;
      try {
        var err = biosealSDK.id3BiosealCertificateInformation_GetSubjectOrganizationalUnit(_pHandle.value, pSubjectOrganizationalUnit, pSubjectOrganizationalUnitSize);
        if (err == BiosealError.insufficientBuffer.value) {
          pSubjectOrganizationalUnit = calloc.allocate(pSubjectOrganizationalUnitSize.value);
          err = biosealSDK.id3BiosealCertificateInformation_GetSubjectOrganizationalUnit(_pHandle.value, pSubjectOrganizationalUnit, pSubjectOrganizationalUnitSize);
          if (err != BiosealError.success.value) {
            throw BiosealException(err);
          }
        }
        final vSubjectOrganizationalUnit = utf8.decode(Uint8List.fromList(pSubjectOrganizationalUnit.cast<Uint8>().asTypedList(pSubjectOrganizationalUnitSize.value)));
        return vSubjectOrganizationalUnit;
      } finally {
        calloc.free(pSubjectOrganizationalUnit);
        calloc.free(pSubjectOrganizationalUnitSize);
      }
    }