Search all over the network, there is no detailed description. Only on one page has the introduction, also ambiguous, address is: http://docs.oracle.com/cd/E19398-01/820-1228/gfnmj/index.html
Later, the code was analyzed to find their differences.
1. Attached method is to put the signature content and the original text together, in the format of PKCS7 packaging. There is a section in the PKCS7 structure that can be put in plaintext, but the plaintext must be ASN.1 encoded. Extract the plaintext while the digital signature is being verified. The plaintext here is actually a summary of the real content.
2. Detached packaging does not contain plaintext information in the PKCS7 format package. Therefore, when validating, it is necessary to pass clear text in order to verify success. In the same vein, the plaintext here is actually a summary of the real content.
From the search results, the application of the detached method is much more frequent.
The following address has code examples for both:
Http://blog.sina.com.cn/s/blog_4fcd1ea30100z8rz.html
PKCS7 digital signatures for attached and detached methods