gitee.com/lh-her-team/common@v1.5.1/crypto/hsm/dummy.go (about) 1 package hsm 2 3 import "fmt" 4 5 type dummyAdapter struct { 6 } 7 8 func (i dummyAdapter) PKCS11_GetSM2KeyId(keyIdex int, isPrivate bool) (string, error) { 9 return fmt.Sprintf("%d", keyIdex), nil 10 } 11 12 func (i dummyAdapter) PKCS11_GetRSAKeyId(keyIdex int, isPrivate bool) (string, error) { 13 return fmt.Sprintf("%d", keyIdex), nil 14 } 15 16 func (i dummyAdapter) PKCS11_GetECCKeyId(keyIdex int, isPrivate bool) (string, error) { 17 return fmt.Sprintf("%d", keyIdex), nil 18 } 19 20 func (i dummyAdapter) PKCS11_GetSM4KeyId(keyIdex int) (string, error) { 21 return fmt.Sprintf("%d", keyIdex), nil 22 } 23 24 func (i dummyAdapter) PKCS11_GetAESKeyId(keyIdex int) (string, error) { 25 return fmt.Sprintf("%d", keyIdex), nil 26 } 27 28 func (i dummyAdapter) PKCS11_GetSM3SM2CKM() uint { 29 return 0 30 } 31 32 func (i dummyAdapter) SDF_GetSM2KeyAccessRight(keyIdex int) (newKeyIdex int, need bool) { 33 return keyIdex, false 34 } 35 36 func (i dummyAdapter) SDF_GetSM4KeyAccessRight(keyIdex int) (newKeyIdex int, need bool) { 37 return keyIdex, false 38 } 39 40 func (i dummyAdapter) SDF_GetRSAKeyAccessRight(keyIdex int) (newKeyIdex int, need bool) { 41 return keyIdex, false 42 } 43 44 func (i dummyAdapter) SDF_GetAESKeyAccessRight(keyIdex int) (newKeyIdex int, need bool) { 45 return keyIdex, false 46 }