package hashvault

import "github.com/fiskerinc/cloud-services/pkg/common"

type VaultMock struct {
}

func (vm VaultMock) CreateCertificate(cn string, certificateType string, isEU bool) (*common.Certificate, error) {
	if isEU {
		return &common.Certificate{Type: certificateType, CommonName: cn, Valid: true, PublicKey: "testEU"}, nil
	}
	return &common.Certificate{Type: certificateType, CommonName: cn, Valid: true, PublicKey: "test"}, nil
}

func (vm VaultMock) CreatePKICertificate(cn string) (*common.Certificate, error) {
	return &common.Certificate{Type: "rsa", CommonName: cn, Valid: true, PublicKey: "test"}, nil
}

func (vm VaultMock) RevokeCertificate(serial string, certType string) (*common.Certificate, error) {
	return &common.Certificate{SerialNumber: serial, Valid: false}, nil
}

func (vm VaultMock) RenewCertificate(commonName string, privateKey string, certType string) (*common.Certificate, error) {
	return &common.Certificate{PublicKey: "test", CommonName: commonName, Valid: true, Type: certType}, nil
}
