@classmethod
def create(cls, pskc, value):
    """Construct an encryped value from a plaintext value."""
    if not isinstance(value, type(b'')):
        value = value.encode()
    cipher_value = pskc.encryption.encrypt_value(value)
    mac_value = None
    if pskc.mac.algorithm:
        mac_value = pskc.mac.generate_mac(cipher_value)
    return cls(cipher_value, mac_value, pskc.encryption.algorithm)
