code: public static AlgorithmIdentifier getSignerAlgoritmIdentifier(Signer signer)
      {
          if (signer instanceof ContentSigner) {
              return ((ContentSigner) signer).getAlgorithmIdentifier();
          } else {
              return AlgorithmIdentifier.getInstance(signer.getEncoded());
          }
      }
docs: Get the algorithm identifier of a signer.
  
  @param signer the signer.
  @return an algorithm identifier.