public org.hyperledger.besu.datatypes.CodeDelegation signAndBuild(final KeyPair keyPair) {
      final BytesValueRLPOutput output = new BytesValueRLPOutput();
      output.startList();
      output.writeBigIntegerScalar(chainId);
      output.writeBytes(address);
      output.writeLongScalar(nonce);
      output.endList();

      signature(
          SIGNATURE_ALGORITHM
              .get()
              .sign(Hash.hash(Bytes.concatenate(MAGIC, output.encoded())), keyPair));
      return build();
    }
Sign the authorization with the given key pair and return the authorization.

@param keyPair the key pair
@return CodeDelegation
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/CodeDelegation.java