code: public static byte[] sign(SecurityAlgorithm securityAlgorithm,
                                PrivateKey privateKey,
                                ByteBuffer... buffers) throws UaException {
  
          String transformation = securityAlgorithm.getTransformation();
  
          try {
              Signature signature = Signature.getInstance(transformation);
              signature.initSign(privateKey);
  
              for (ByteBuffer buffer : buffers) {
                  signature.update(buffer);
              }
  
              return signature.sign();
          } catch (GeneralSecurityException e) {
              throw new UaException(StatusCodes.Bad_InternalError, e);
          }
      }
docs: Sign the contents of the provided buffers using the provided {@link SecurityAlgorithm}.
  Note that only the bytes between position and limit of each buffer are considered.
  
  @param securityAlgorithm the {@link SecurityAlgorithm}.
  @param privateKey        the {@link PrivateKey} to sign with.
  @param buffers           the data to sign.
  @return the signature bytes.
  @throws UaException