]> Cypherpunks.ru repositories - pygost.git/commitdiff
cert-dane-hash takes data from stdin for convenience
authorSergey Matveev <stargrave@stargrave.org>
Thu, 17 Mar 2022 09:47:13 +0000 (12:47 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 17 Mar 2022 09:47:13 +0000 (12:47 +0300)
pygost/asn1schemas/cert-dane-hash.py

index ac891c14083ccbbdada8ca7c34db1c4c3ffefc4b..0292b9ea3b984d46c14a92c72dfb229c1614a82e 100755 (executable)
@@ -9,8 +9,7 @@ import sys
 from pygost.asn1schemas.x509 import Certificate
 
 
 from pygost.asn1schemas.x509 import Certificate
 
 
-with open(sys.argv[1], "rb") as fd:
-    lines = fd.read().decode("ascii").split("-----")
+lines = sys.stdin.read().split("-----")
 idx = lines.index("BEGIN CERTIFICATE")
 if idx == -1:
     raise ValueError("PEM has no CERTIFICATE")
 idx = lines.index("BEGIN CERTIFICATE")
 if idx == -1:
     raise ValueError("PEM has no CERTIFICATE")