Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-8326

Refactor CryptoToken.getPublicKey, return javadoc differs from implementation, use Optional

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Issue discovered during:
      Jenkins

      Description

      CryptoToken.getPublicKey says:

      /** Returns the public key (if possible) of token.
      *

      • @param alias the key alias to retrieve from the token
      • @throws CryptoTokenOfflineException if Crypto Token is not available or connected
      • @return the public key, or null if key with the alias does not exist.
        */
        PublicKey getPublicKey(String alias) throws CryptoTokenOfflineException;

       

      But BaseCryptoToken, which Soft and PKCS11 crypto token extends throws CryptoTokenOfflineException if the alias does not exist.

      The new AzureCryptoToken has implemented the javadoc and return null.

      The code needs to be verified if it should throw or return null, update javadoc and the code.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              tomas Tomas Gustavsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 4 hours
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified