digital signature - Signing PDF with rsa_sha1 -


i'm trying sign pdf rsa_sha1(adobe.ppklite > adbe.x509.rsa_sha1), , have 2 problems/questions:

  1. don't know if actual pdf content specified byterange should signed, or digest value of content?
  2. is there difference if certificate placed before signature field, or after?

i'm trying sign pdf rsa_sha1(adobe.ppklite > adbe.x509.rsa_sha1)

are sure want use subfilter? further development concerning integrated pdf signatures makes use of integrated cms containers, not naked pkcs#1 signatures...

don't know if actual pdf content specified byterange should signed, or digest value of content?

in contrast adobe.pkcs7.sha1 style signatures , adobe.pkcs7.detached style signatures, whole byte range signed in adobe.x509.rsa_sha1 style signatures, not merely digest value of content. in respect adobe.x509.rsa_sha1 preferable adobe.pkcs7.sha1 because (despite appearance of sha1 in name) not force use sha1 can use better digest algorithms.

(this being said, signing process of course include creating digest value of signed data, that's different matter altogether...)

is there difference if certificate placed before signature field, or after?

both certificates , signature elements in pdf dictionary object, , definition order of elements in such dictionary not matter. obviously, though, order must remain fixed (actually not merely order exact position , contents) once signature created.

the entries in dictionary represent associative table , such shall unordered though arbitrary order may imposed upon them when written in file. ordering shall ignored.

(section 7.3.7 in iso 32000-1)

ps: specification says signature

shall computed on range of bytes in file, shall indicated byterange entry in signature dictionary. range should entire file, including signature dictionary excluding signature value (the contents entry). other ranges may used since not check changes document, use not recommended.

(section 12.8.1 in iso 32000-1)

this seems allow other byte ranges recommended 1 (everything actual signature bytes), too. actually, though, you'll find

for byte range signatures, contents shall hexadecimal string “<” , “>” delimiters. it shall fit precisely in space between ranges specified byterange.

(section 12.8.3.3.2 in iso 32000-1)

which makes should in citation before actual shall if interoperability desired. e.g. adobe reader requires kind of range definition.

newer standards, e.g. etsi pades technical specification documents, more explicitly require it.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -