public static KeyPair loadKeyPairFromResource(final String resourcePath) {
    final KeyPair keyPair;
    String keyData = loadResourceFile(resourcePath);
    if (keyData == null || keyData.isEmpty()) {
      throw new IllegalArgumentException("Unable to load resource: " + resourcePath);
    }
    SECPPrivateKey privateKey =
        SIGNATURE_ALGORITHM.get().createPrivateKey(Bytes32.fromHexString((keyData)));
    keyPair = SIGNATURE_ALGORITHM.get().createKeyPair(privateKey);

    LOG.info("Loaded keyPair {} from {}", keyPair.getPublicKey().toString(), resourcePath);
    return keyPair;
  }
Load key pair from resource.

@param resourcePath the resource path
@return the key pair
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/KeyPairUtil.java