This repository has been archived by the owner on Nov 29, 2022. It is now read-only.
/
EmptyKeyManager.java
72 lines (60 loc) · 2.09 KB
/
EmptyKeyManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Copyright 2009 Vladimir Sch�fer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.saml.key;
import org.opensaml.xml.security.CriteriaSet;
import org.opensaml.xml.security.SecurityException;
import org.opensaml.xml.security.credential.Credential;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.cert.X509Certificate;
import java.util.*;
/**
* Key manager doesn't provide access to any keys and can be used to skip inclusion of keystore files in the
* Spring SAML projects. Empty key store can only be used in situations when Spring SAML doesn't perform decryption
* of incoming messages and doesn't need to create digital signatures.
*
* @author Vladimir Schafer
*/
public class EmptyKeyManager implements KeyManager {
private final Logger log = LoggerFactory.getLogger(EmptyKeyManager.class);
@Override
public Credential getCredential(String keyName) {
return null;
}
@Override
public Credential getDefaultCredential() {
return null;
}
@Override
public String getDefaultCredentialName() {
return null;
}
@Override
public Set<String> getAvailableCredentials() {
return Collections.emptySet();
}
@Override
public X509Certificate getCertificate(String alias) {
return null;
}
@Override
public Iterable<Credential> resolve(CriteriaSet criteria) throws SecurityException {
return null;
}
@Override
public Credential resolveSingle(CriteriaSet criteria) throws SecurityException {
return null;
}
}