congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PdfString.getOriginalBytes
Code IndexAdd Tabnine to your IDE (free)

How to use
getOriginalBytes
method
in
com.itextpdf.text.pdf.PdfString

Best Java code snippets using com.itextpdf.text.pdf.PdfString.getOriginalBytes (Showing top 5 results out of 315)

origin: stackoverflow.com

 AcroFields fields = reader.getAcroFields();
PdfDictionary sigDict = fields.getSignatureDictionary(name); 
PdfString contents = sigDict.getAsString(PdfName.CONTENTS);
byte[] contentBytes = contents.getOriginalBytes();
origin: com.itextpdf/itextg

private PdfName getSignatureHashKey(String signatureName) throws NoSuchAlgorithmException, IOException {
  PdfDictionary dic = acroFields.getSignatureDictionary(signatureName);
  PdfString contents = dic.getAsString(PdfName.CONTENTS);
  byte[] bc = contents.getOriginalBytes();
  byte[] bt = null;
  if (PdfName.ETSI_RFC3161.equals(PdfReader.getPdfObject(dic.get(PdfName.SUBFILTER)))) {
    ASN1InputStream din = new ASN1InputStream(new ByteArrayInputStream(bc));
    ASN1Primitive pkcs = din.readObject();
    bc = pkcs.getEncoded();
  }
  bt = hashBytesSha1(bc);
  return new PdfName(Utilities.convertToHex(bt));
}
origin: com.itextpdf/itextpdf

private PdfName getSignatureHashKey(String signatureName) throws NoSuchAlgorithmException, IOException {
  PdfDictionary dic = acroFields.getSignatureDictionary(signatureName);
  PdfString contents = dic.getAsString(PdfName.CONTENTS);
  byte[] bc = null;
  if(!reader.isEncrypted()) {
    bc = contents.getOriginalBytes();
  }else{
    bc = contents.getBytes();
  }
  byte[] bt = null;
  if (PdfName.ETSI_RFC3161.equals(PdfReader.getPdfObject(dic.get(PdfName.SUBFILTER)))) {
    ASN1InputStream din = new ASN1InputStream(new ByteArrayInputStream(bc));
    ASN1Primitive pkcs = din.readObject();
    bc = pkcs.getEncoded();
  }
  bt = hashBytesSha1(bc);
  return new PdfName(Utilities.convertToHex(bt));
}
origin: com.itextpdf/itextg

  if (cert == null)
    cert = v.getAsArray(PdfName.CERT).getAsString(0);
  pk = new PdfPKCS7(contents.getOriginalBytes(), cert.getBytes(), provider);
  pk = new PdfPKCS7(contents.getOriginalBytes(), sub, provider);
updateByteRange(pk, v);
PdfString str = v.getAsString(PdfName.M);
origin: com.itextpdf/itextpdf

  cert = v.getAsArray(PdfName.CERT).getAsString(0);
if(!reader.isEncrypted()) {
  pk = new PdfPKCS7(contents.getOriginalBytes(), cert.getBytes(), provider);
}else{
  pk = new PdfPKCS7(contents.getBytes(), cert.getBytes(), provider);
  pk = new PdfPKCS7(contents.getOriginalBytes(), sub, provider);
}else{
  pk = new PdfPKCS7(contents.getBytes(),sub,provider);
com.itextpdf.text.pdfPdfStringgetOriginalBytes

Popular methods of PdfString

  • <init>
    Constructs a PdfString-object.
  • toString
    Returns the String value of this PdfString-object.
  • getBytes
  • toUnicodeString
    Returns the Unicode String value of thisPdfString-object.
  • decrypt
    Decrypt an encrypted PdfString
  • getEncoding
    Gets the encoding of this string.
  • isHexWriting
  • length
  • setHexWriting
  • setObjNum

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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