Tabnine Logo
PdfEncryption.encryptByteArray
Code IndexAdd Tabnine to your IDE (free)

How to use
encryptByteArray
method
in
com.lowagie.text.pdf.PdfEncryption

Best Java code snippets using com.lowagie.text.pdf.PdfEncryption.encryptByteArray (Showing top 12 results out of 315)

origin: es.gob.afirma/afirma-crypto-pdf-itext

  public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
    byte[] b = PdfReader.getStreamBytesRaw(this);
    PdfEncryption crypto = null;
    if (writer != null)
      crypto = writer.getEncryption();
    PdfObject objLen = get(PdfName.LENGTH);
    int nn = b.length;
    if (crypto != null)
      nn = crypto.calculateStreamSize(nn);
    put(PdfName.LENGTH, new PdfNumber(nn));
    superToPdf(writer, os);
    put(PdfName.LENGTH, objLen);
    os.write(STARTSTREAM);
    if (length > 0) {
      if (crypto != null && !crypto.isEmbeddedFilesOnly())
        b = crypto.encryptByteArray(b);
      os.write(b);
    }
    os.write(ENDSTREAM);
  }
}
origin: com.github.librepdf/openpdf

  public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
    byte[] b = PdfReader.getStreamBytesRaw(this);
    PdfEncryption crypto = null;
    if (writer != null)
      crypto = writer.getEncryption();
    PdfObject objLen = get(PdfName.LENGTH);
    int nn = b.length;
    if (crypto != null)
      nn = crypto.calculateStreamSize(nn);
    put(PdfName.LENGTH, new PdfNumber(nn));
    superToPdf(writer, os);
    put(PdfName.LENGTH, objLen);
    os.write(STARTSTREAM);
    if (length > 0) {
      if (crypto != null && !crypto.isEmbeddedFilesOnly())
        b = crypto.encryptByteArray(b);
      os.write(b);
    }
    os.write(ENDSTREAM);
  }
}
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

  public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
    byte[] b = PdfReader.getStreamBytesRaw(this);
    PdfEncryption crypto = null;
    if (writer != null)
      crypto = writer.getEncryption();
    PdfObject objLen = get(PdfName.LENGTH);
    int nn = b.length;
    if (crypto != null)
      nn = crypto.calculateStreamSize(nn);
    put(PdfName.LENGTH, new PdfNumber(nn));
    superToPdf(writer, os);
    put(PdfName.LENGTH, objLen);
    os.write(STARTSTREAM);
    if (length > 0) {
      if (crypto != null && !crypto.isEmbeddedFilesOnly())
        b = crypto.encryptByteArray(b);
      os.write(b);
    }
    os.write(ENDSTREAM);
  }
}
origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Writes the PDF representation of this <CODE>PdfString</CODE> as an array
 * of <CODE>byte</CODE> to the specified <CODE>OutputStream</CODE>.
 * 
 * @param writer for backwards compatibility
 * @param os The <CODE>OutputStream</CODE> to write the bytes to.
 */
public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
  byte b[] = getBytes();
  PdfEncryption crypto = null;
  if (writer != null)
    crypto = writer.getEncryption();
  if (crypto != null && !crypto.isEmbeddedFilesOnly())
    b = crypto.encryptByteArray(b);
  if (hexWriting) {
    ByteBuffer buf = new ByteBuffer();
    buf.append('<');
    int len = b.length;
    for (int k = 0; k < len; ++k)
      buf.appendHex(b[k]);
    buf.append('>');
    os.write(buf.toByteArray());
  }
  else
    os.write(PdfContentByte.escapeString(b));
}

origin: com.github.librepdf/openpdf

/**
 * Writes the PDF representation of this <CODE>PdfString</CODE> as an array
 * of <CODE>byte</CODE> to the specified <CODE>OutputStream</CODE>.
 * 
 * @param writer for backwards compatibility
 * @param os The <CODE>OutputStream</CODE> to write the bytes to.
 */
public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
  byte[] b = getBytes();
  PdfEncryption crypto = null;
  if (writer != null)
    crypto = writer.getEncryption();
  if (crypto != null && !crypto.isEmbeddedFilesOnly())
    b = crypto.encryptByteArray(b);
  if (hexWriting) {
    ByteBuffer buf = new ByteBuffer();
    buf.append('<');
    int len = b.length;
    for (int k = 0; k < len; ++k)
      buf.appendHex(b[k]);
    buf.append('>');
    os.write(buf.toByteArray());
  }
  else
    os.write(PdfContentByte.escapeString(b));
}
 
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Writes the PDF representation of this <CODE>PdfString</CODE> as an array
 * of <CODE>byte</CODE> to the specified <CODE>OutputStream</CODE>.
 * 
 * @param writer for backwards compatibility
 * @param os The <CODE>OutputStream</CODE> to write the bytes to.
 */
public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
  byte b[] = getBytes();
  PdfEncryption crypto = null;
  if (writer != null)
    crypto = writer.getEncryption();
  if (crypto != null && !crypto.isEmbeddedFilesOnly())
    b = crypto.encryptByteArray(b);
  if (hexWriting) {
    ByteBuffer buf = new ByteBuffer();
    buf.append('<');
    int len = b.length;
    for (int k = 0; k < len; ++k)
      buf.appendHex(b[k]);
    buf.append('>');
    os.write(buf.toByteArray());
  }
  else
    os.write(PdfContentByte.escapeString(b));
}
 
origin: es.gob.afirma/afirma-crypto-pdf-itext

byte b[];
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

byte b[];
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
origin: com.github.librepdf/openpdf

byte[] b;
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
origin: es.gob.afirma/afirma-crypto-pdf-itext

byte b[];
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
origin: com.github.librepdf/openpdf

byte[] b;
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
origin: fr.opensagres.xdocreport.itext-gae/itext-gae

byte b[];
if (streamBytes != null) {
  b = crypto.encryptByteArray(streamBytes.toByteArray());
  b = crypto.encryptByteArray(bytes);
com.lowagie.text.pdfPdfEncryptionencryptByteArray

Popular methods of PdfEncryption

  • <init>
  • addRecipient
  • calculateStreamSize
  • computeOwnerKey
  • computeUserPassword
  • createDocumentId
  • createInfoId
  • decryptByteArray
  • getCryptoMode
  • getDecryptor
  • getEncryptionDictionary
  • getEncryptionStream
  • getEncryptionDictionary,
  • getEncryptionStream,
  • getFileID,
  • isEmbeddedFilesOnly,
  • isMetadataEncrypted,
  • padPassword,
  • setCryptoMode,
  • setHashKey,
  • setupAllKeys

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JFrame (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now