Completed
Push — master ( ad4833...6593bf )
by Florent
11:24 queued 02:15
created

JWE::getEncryptionAlgorithm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Object;
13
14
/**
15
 * Class JWE.
16
 */
17
final class JWE extends JWT implements JWEInterface
18
{
19
    /**
20
     * @var string|null
21
     */
22
    private $ciphertext = null;
23
24
    /**
25
     * @var string|null
26
     */
27
    private $encrypted_key = null;
28
29
    /**
30
     * @var string|null
31
     */
32
    private $iv = null;
33
34
    /**
35
     * @var string|null
36
     */
37
    private $aad = null;
38
39
    /**
40
     * @var string|null
41
     */
42
    private $tag = null;
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getCiphertext()
48
    {
49
        return $this->ciphertext;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function withCiphertext($ciphertext)
56
    {
57
        $jwe = clone $this;
58
        $jwe->ciphertext = $ciphertext;
59
60
        return $jwe;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function getEncryptedKey()
67
    {
68
        return $this->encrypted_key;
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function withEncryptedKey($encrypted_key)
75
    {
76
        $jwe = clone $this;
77
        $jwe->encrypted_key = $encrypted_key;
78
79
        return $jwe;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function getAAD()
86
    {
87
        return $this->aad;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function withAAD($aad)
94
    {
95
        $jwe = clone $this;
96
        $jwe->aad = $aad;
97
98
        return $jwe;
99
    }
100
101
    /**
102
     * {@inheritdoc}
103
     */
104
    public function getIV()
105
    {
106
        return $this->iv;
107
    }
108
109
    /**
110
     * {@inheritdoc}
111
     */
112
    public function withIV($iv)
113
    {
114
        $jwe = clone $this;
115
        $jwe->iv = $iv;
116
117
        return $jwe;
118
    }
119
120
    /**
121
     * {@inheritdoc}
122
     */
123
    public function getTag()
124
    {
125
        return $this->tag;
126
    }
127
128
    /**
129
     * {@inheritdoc}
130
     */
131
    public function withTag($tag)
132
    {
133
        $jwe = clone $this;
134
        $jwe->tag = $tag;
135
136
        return $jwe;
137
    }
138
}
139