mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	Add ID function to LogInfo to return log ID
This commit is contained in:
		
							parent
							
								
									ff6d1f21fd
								
							
						
					
					
						commit
						4868243259
					
				
							
								
								
									
										6
									
								
								logs.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								logs.go
									
									
									
									
									
								
							@ -11,6 +11,7 @@ package certspotter
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"crypto"
 | 
			
		||||
	"crypto/sha256"
 | 
			
		||||
	"crypto/x509"
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
)
 | 
			
		||||
@ -37,6 +38,11 @@ func (info *LogInfo) ParsedPublicKey() (crypto.PublicKey, error) {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (info *LogInfo) ID() []byte {
 | 
			
		||||
	sum := sha256.Sum256(info.Key)
 | 
			
		||||
	return sum[:]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var DefaultLogs = []LogInfo{
 | 
			
		||||
	{
 | 
			
		||||
		// a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user