Skip to content

Instantly share code, notes, and snippets.

@srialdabaoth
Created March 7, 2018 04:28
Show Gist options
  • Select an option

  • Save srialdabaoth/82697d421856bd83bd6c04ef4c43fe95 to your computer and use it in GitHub Desktop.

Select an option

Save srialdabaoth/82697d421856bd83bd6c04ef4c43fe95 to your computer and use it in GitHub Desktop.
ssl subprocess
import subprocess
content="test"
command = [
"openssl", "smime",
"-binary",
"-sign",
"-certfile", '/home/sri/IdeaProjects/pk2/components/wwdr.pem',
"-signer", '/home/sri/IdeaProjects/pk2/components/com.ndudfield.nfc.pem',
"-in", "manifest.json",
"-out", "signature",
"-outform", 'DER',
]
process = subprocess.Popen(
command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
stdout, stderr = process.communicate(content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment