code: public final int sign(byte[] outbuf, int offset, int len)
          throws SignatureException {
          if (outbuf == null) {
              throw new IllegalArgumentException("No output buffer given");
          }
          if (offset < 0 || len < 0) {
              throw new IllegalArgumentException("offset or len is less than 0");
          }
          if (outbuf.length - offset < len) {
              throw new IllegalArgumentException
                  ("Output buffer too small for specified offset and length");
          }
          if (state != SIGN) {
              throw new SignatureException("object not initialized for " +
                                           "signing");
          }
          return engineSign(outbuf, offset, len);
      }
docs: Finishes the signature operation and stores the resulting signature
  bytes in the provided buffer {@code outbuf}, starting at
  {@code offset}.
  The format of the signature depends on the underlying
  signature scheme.
  
  <p>This signature object is reset to its initial state (the state it
  was in after a call to one of the {@code initSign} methods) and
  can be reused to generate further signatures with the same private key.
  
  @param outbuf buffer for the signature result.
  
  @param offset offset into {@code outbuf} where the signature is
  stored.
  
  @param len number of bytes within {@code outbuf} allotted for the
  signature.
  
  @return the number of bytes placed into {@code outbuf}.
  
  @exception SignatureException if this signature object is not
  initialized properly, if this signature algorithm is unable to
  process the input data provided, or if {@code len} is less
  than the actual signature length.
  
  @since 1.2