Currently the CertificateUsage only provides a limited set of functionalities. For example, to translate a usage string into a usage object, one has to write the following code: Iterator iterator = CertificateUsage.getCertificateUsages(); while (iterator.hasNext()) { CertificateUsage usage = (CertificateUsage)iterator.next(); String name = usage.toString(); if (name.equalsIgnoreCase(usageStr)) return usage; } return null; There are some improvements that can be done to make CertificateUsage more usable. 1. The getCertificateUsage() should return a Collection<CertificateUsage> instead of a plain Iterator. Then the above code could be simplified as follows: for (CertificateUsage usage : CertificateUsage.getCertificateUsages()) { String name = usage.toString(); if (name.equalsIgnoreCase(usageStr)) return usage; } return null; If backward compatibility is important, the CertificateUsage should provide a different method or a static Collection<CertificateUsage> which returns all usage objects: for (CertificateUsage usage : CertificateUsage.ALL_USAGES) { String name = usage.toString(); if (name.equalsIgnoreCase(usageStr)) return usage; } return null; 2. The CertificateUsage should provide proper getter methods for its fields or make them public: for (CertificateUsage usage : CertificateUsage.ALL_USAGES) { String name = usage.getName(); if (name.equalsIgnoreCase(usageStr)) return usage; } return null; 3. The CertificateUsage should provide the above code as a static method, so translating a usage string into a usage object can simply be done as follows: CertificateUsage usage = CertificateUsage.valueOf(usageStr); This method can also be implemented using a HashMap<String, CertificateUsage> instead of Collection<CertificateUsage>.
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.