Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: appengine/components/components/auth/signature.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The LUCI Authors. All rights reserved. 1 # Copyright 2014 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Functions to produce and verify RSA+SHA256 signatures. 5 """Functions to produce and verify RSA+SHA256 signatures.
6 6
7 Based on app_identity.sign_blob() and app_identity.get_public_certificates() 7 Based on app_identity.sign_blob() and app_identity.get_public_certificates()
8 functions, and thus private keys are managed by GAE. 8 functions, and thus private keys are managed by GAE.
9 """ 9 """
10 10
11 import base64 11 import base64
12 import json 12 import json
13 import logging 13 import logging
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 # Extract subjectPublicKeyInfo field from X.509 certificate (see RFC3280). 253 # Extract subjectPublicKeyInfo field from X.509 certificate (see RFC3280).
254 cert = asn1.DerSequence() 254 cert = asn1.DerSequence()
255 cert.decode(der) 255 cert.decode(der)
256 tbsCertificate = asn1.DerSequence() 256 tbsCertificate = asn1.DerSequence()
257 tbsCertificate.decode(cert[0]) 257 tbsCertificate.decode(cert[0])
258 subjectPublicKeyInfo = tbsCertificate[6] 258 subjectPublicKeyInfo = tbsCertificate[6]
259 259
260 verifier = PKCS1_v1_5.new(RSA.importKey(subjectPublicKeyInfo)) 260 verifier = PKCS1_v1_5.new(RSA.importKey(subjectPublicKeyInfo))
261 return verifier.verify(SHA256.new(blob), signature) 261 return verifier.verify(SHA256.new(blob), signature)
OLDNEW
« no previous file with comments | « appengine/components/components/auth/service_account_test.py ('k') | appengine/components/components/auth/signature_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698