public PublicKey getPublicKey_X509Encoded(byte[] keyBytes){  
       try {
           X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);  
           KeyFactory keyFactory = KeyFactory.getInstance(algorithm);  
           return keyFactory.generatePublic(spec);  
		} catch (Exception e) {
			log.error(e.getMessage(),e);
		}
       return null;
    }
public PublicKey getPublicKey_X509Encoded ( byte [ ] keyBytes ) { try { X509EncodedKeySpec spec = new X509EncodedKeySpec ( keyBytes ) ; KeyFactory keyFactory = KeyFactory . getInstance ( algorithm ) ; return keyFactory . generatePublic ( spec ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } return null ; }
根据公钥字符串获取公钥
Only RSAPublicKeySpec and X509EncodedKeySpec supported for RSA public keys
@param publicKey
@return