mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	Add TimestampTime() to ct.SignedTreeHead
This commit is contained in:
		
							parent
							
								
									9b29ca93b8
								
							
						
					
					
						commit
						fe4ef6b05d
					
				@ -6,6 +6,7 @@ import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
@ -289,6 +290,10 @@ type SignedTreeHead struct {
 | 
			
		||||
	LogID             SHA256Hash      `json:"log_id"`              // The SHA256 hash of the log's public key
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (sth *SignedTreeHead) TimestampTime() time.Time {
 | 
			
		||||
	return time.Unix(int64(sth.Timestamp/1000), int64(sth.Timestamp%1000)*1_000_000).UTC()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SignedCertificateTimestamp represents the structure returned by the
 | 
			
		||||
// add-chain and add-pre-chain methods after base64 decoding. (see RFC sections
 | 
			
		||||
// 3.2 ,4.1 and 4.2)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user