Refactor token verification to support x5c header
Refactor token verification to support x5c header

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

jmitchell/distribution,miminar/distribution,runcom/distribution,hpcloud/distribution,beni55/distribution,hanleys/distribution,dave-tucker/distribution,runcom/distribution,tian-xiaobo/distribution,qiniu/distribution,jmitchell/distribution,johnstep/docker.github.io,BrianBland/distribution,liubin/distribution,rbarlow/distribution,vdemeester/distribution,jonboulle/distribution,iskradelta/distribution,jrjang/distribution,orivej/distribution,aduermael/docker.github.io,endophage/distribution,paulczar/distribution,menglingwei/denverdino.github.io,konnase/distribution,andrewnguyen/distribution,yuwaMSFT2/distribution,dalanlan/distribution,jlhawn/distribution,mbentley/distribution,maquanyi/distribution,aprajshekhar/distribution,manoj535/distribution,joeuo/docker.github.io,danix800/docker.github.io,huamai-io/distribution,LuisBosquez/docker.github.io,harrisonfeng/distribution,joeuo/docker.github.io,jzwlqx/distribution,codefresh-io/cf-distribution,iskradelta/distribution,danix800/docker.github.io,menglingwei/denverdino.github.io,bsmr-docker/distribution,aprajshekhar/distribution,djenriquez/distribution,vdemeester/distribution,AoJ/distribution,jrjang/distribution,mboersma/distribution,lcarstensen/distribution,sebrandon1/distribution,dmcgowan/distribution,rillig/docker.github.io,shin-/docker.github.io,moxiegirl/distribution,anweiss/docker.github.io,denverdino/docker.github.io,endophage/distribution,tt/distribution,phiroict/docker,n1tr0g/distribution,RyanDeng/distribution,aduermael/docker.github.io,harche/distribution,joeuo/docker.github.io,joaofnfernandes/docker.github.io,docker-zh/docker.github.io,spacexnice/distribution,curtiszimmerman/distribution,bsmr-docker/distribution,avinson/distribution,jzwlqx/denverdino.github.io,JimGalasyn/docker.github.io,joaofnfernandes/docker.github.io,duglin/distribution,rbarlow/distribution,avinson/distribution,cezarsa/distribution,phiroict/docker,baloo/distribution,bdwill/docker.github.io,shubheksha/docker.github.io,estesp/distribution,denverdino/denverdino.github.io,deis/distribution,rillig/docker.github.io,denverdino/docker.github.io,jzwlqx/denverdino.github.io,adambrett-forks/distribution,andrewnguyen/distribution,denverdino/denverdino.github.io,humble00/distribution,ChenLingPeng/distribution,convox/distribution,atyenoria/distribution,dalanlan/distribution,jlhawn/distribution,danix800/docker.github.io,alexisbellido/docker.github.io,bxy09/distribution,bobphill/distribution,sergeyfd/distribution,thelinuxkid/distribution,sanscontext/docker.github.io,rillig/docker.github.io,genedock/distribution,BrickXu/distribution,tdooner/distribution,LuisBosquez/docker.github.io,zhaytee/distribution,moxiegirl/distribution,RyanDeng/distribution,hopkings2008/distribution,gdevillele/docker.github.io,troy0820/docker.github.io,gierschv/distribution,nevermosby/distribution,yeghishe/distribution,linearregression/distribution,JimGalasyn/docker.github.io,dobril-stanga/distribution,GerritForge/docker-registry,Gobliip/distribution,joaofnfernandes/docker.github.io,denverdino/distribution-stevvooe,schu/distribution,maquanyi/distribution,Tiesheng/distribution,AoJ/distribution,deis/distribution,anweiss/docker.github.io,baloo/distribution,thaJeztah/docker.github.io,rhoml/distribution,docker/docker.github.io,thaJeztah/docker.github.io,BSWANG/denverdino.github.io,dmcgowan/distribution,troy0820/docker.github.io,spacexnice/distribution,aaronlehmann/distribution,genedock/distribution,BSWANG/denverdino.github.io,bpradipt/distribution,armbuilds/distribution,wangmingshuai/distribution,nwt/distribution,CodeJuan/distribution,JimGalasyn/docker.github.io,whyrusleeping/distribution,menglingwei/denverdino.github.io,docker/docker.github.io,LouisKottmann/distribution,apuigsech/distribution,Tiesheng/distribution,sanscontext/docker.github.io,humble00/distribution,lcarstensen/distribution,bxy09/distribution,gdevillele/docker.github.io,n1tr0g/distribution,noxiouz/distribution,danix800/docker.github.io,stevvooe/distribution,13W/distribution,phiroict/docker,thaJeztah/distribution,gorcz/distribution,zerosign/distribution,anweiss/docker.github.io,cyli/distribution,jramseye/distribution,troy0820/docker.github.io,jordimassaguerpla/distribution,rodacom/docker-hub,bigsurge/distribution,rochacon/distribution,icecrime/distribution,denverdino/denverdino.github.io,anweiss/docker.github.io,alexisbellido/docker.github.io,lindenlab/distribution,denverdino/distribution-fuse,konstruktoid/distribution,tianon/docker-distribution,thaJeztah/docker.github.io,rillig/docker.github.io,troy0820/docker.github.io,jackpgriffin/distribution,alexisbellido/docker.github.io,mikebrow/distribution,BradleyA/distribution,Gobliip/distribution,BradleyA/distribution,pdevine/distribution,johnstep/docker.github.io,shubheksha/docker.github.io,BSWANG/denverdino.github.io,arneluehrs/distribution,docker/docker.github.io,higebu/distribution,wking/docker-distribution,jwhonce/distribution,AndreyKostov/distribution,schu/distribution,bdwill/docker.github.io,phiroict/docker,RichardScothern/distribution,LouisKottmann/distribution,mbentley/distribution,mboersma/distribution,tt/distribution,noxiouz/distribution,Seb-Solon/distribution,bpradipt/distribution,rochacon/distribution,stevvooe/docker-registry,arvindkandhare/distribution,dtromb/distribution,irachex/distribution,pdevine/distribution,gavioto/distribution,shin-/docker.github.io,gdevillele/docker.github.io,cezarsa/distribution,LuisBosquez/docker.github.io,arvindkandhare/distribution,sthapaun/distribution,rodacom/docker-hub,shin-/docker.github.io,mattrgreen/distribution,apuigsech/distribution,johnstep/docker.github.io,stevvooe/distribution,docker/distribution,yuwaMSFT2/distribution,sthapaun/distribution,londoncalling/docker.github.io,ContainerSolutions/distribution,sanscontext/docker.github.io,aduermael/docker.github.io,donhcd/distribution,Seb-Solon/distribution,ContainerSolutions/distribution,nwt/distribution,LuisBosquez/docker.github.io,calavera/distribution,bigsurge/distribution,codefresh-io/cf-distribution,londoncalling/docker.github.io,tianon/docker-distribution,thaJeztah/docker.github.io,shyr/distribution,armbuilds/distribution,londoncalling/docker.github.io,RaviTezu/distribution,estesp/distribution,uptownhr/distribution,alexisbellido/docker.github.io,djenriquez/distribution,jwhonce/distribution,nateww/distribution,harche/distribution,joaofnfernandes/docker.github.io,miminar/distribution,sallyom/distribution,mattmoor/distribution,joeuo/docker.github.io,beni55/distribution,denverdino/docker.github.io,huamai-io/distribution,docker/docker.github.io,denverdino/docker.github.io,gavioto/distribution,shakamunyi/distribution,konstruktoid/distribution,docker-zh/docker.github.io,gdevillele/docker.github.io,thaJeztah/docker.github.io,jordimassaguerpla/distribution,denverdino/denverdino.github.io,sergeyfd/distribution,shin-/docker.github.io,whyrusleeping/distribution,jzwlqx/denverdino.github.io,denverdino/docker.github.io,amitshukla/distribution,irachex/distribution,aibaars/distribution,dmp42/distribution,lebauce/distribution,jzwlqx/denverdino.github.io,gierschv/distribution,shakamunyi/distribution,JimGalasyn/docker.github.io,lebauce/distribution,dave-tucker/distribution,jhicks-camgian/distribution,denverdino/distribution,bdwill/docker.github.io,docker-zh/docker.github.io,kmala/distribution,imranraja85/distribution,docker-zh/docker.github.io,gorcz/distribution,lorieri/distribution,sadlil/distribution,hopkings2008/distribution,menglingwei/denverdino.github.io,denverdino/distribution,uptownhr/distribution,BSWANG/denverdino.github.io,nateww/distribution,AndreyKostov/distribution,convox/distribution,RaviTezu/distribution,londoncalling/docker.github.io,konnase/distribution,jpoler/distribution,johnstep/docker.github.io,bobphill/distribution,tdooner/distribution,wangmingshuai/distribution,linearregression/distribution,zhangcoldwater/distribution,cyli/distribution,tschoots/distribution,phiroict/docker,zerosign/distribution,jackpgriffin/distribution,donhcd/distribution,championv/distribution,mattrgreen/distribution,jzwlqx/distribution,jpoler/distribution,wking/docker-distribution,BrickXu/distribution,CodeJuan/distribution,atyenoria/distribution,tschoots/distribution,menglingwei/denverdino.github.io,anweiss/docker.github.io,shin-/docker.github.io,JimGalasyn/docker.github.io,dobril-stanga/distribution,GerritForge/docker-registry,lindenlab/distribution,sadlil/distribution,dv/distribution,shyr/distribution,xiekeyang/distribution,nevermosby/distribution,ibuildthecloud/distribution,joeuo/docker.github.io,BrianBland/distribution,aaronlehmann/distribution,dmp42/distribution,duglin/distribution,denverdino/denverdino.github.io,liubin/distribution,LuisBosquez/docker.github.io,bdwill/docker.github.io,RichardScothern/distribution,johnstep/docker.github.io,kmala/distribution,shubheksha/docker.github.io,aduermael/docker.github.io,xiekeyang/distribution,yeghishe/distribution,sallyom/distribution,manoj535/distribution,bdwill/docker.github.io,joaofnfernandes/docker.github.io,calavera/distribution,docker/docker.github.io,londoncalling/docker.github.io,curtiszimmerman/distribution,shubheksha/docker.github.io,sanscontext/docker.github.io,sebrandon1/distribution,thaJeztah/distribution,13W/distribution,jonboulle/distribution,hanleys/distribution,BSWANG/denverdino.github.io,imranraja85/distribution,hpcloud/distribution,zhaytee/distribution,arneluehrs/distribution,icecrime/distribution,alexisbellido/docker.github.io,rhoml/distribution,denverdino/distribution-stevvooe,mikebrow/distribution,aybabtme/distribution,adambrett-forks/distribution,tian-xiaobo/distribution,zhangcoldwater/distribution,docker-zh/docker.github.io,thelinuxkid/distribution,ChenLingPeng/distribution,mattmoor/distribution,qiniu/distribution,orivej/distribution,dv/distribution,jhicks-camgian/distribution,stevvooe/docker-registry,amitshukla/distribution,jramseye/distribution,aybabtme/distribution,gdevillele/docker.github.io,paulczar/distribution,harrisonfeng/distribution,shubheksha/docker.github.io,dtromb/distribution,championv/distribution,denverdino/distribution-fuse,ibuildthecloud/distribution,jzwlqx/denverdino.github.io,higebu/distribution,sanscontext/docker.github.io,docker/distribution,aibaars/distribution,lorieri/distribution