4604N/A * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This is a class which supplies several KeySelector implementations 0N/A * KeySelector which would always return the secret key specified in its 0N/A return "Secret key";
0N/A * KeySelector which would retrieve the X509Certificate out of the 0N/A * KeyInfo element and return the public key. 0N/A * NOTE: If there is an X509CRL in the KeyInfo element, then revoked 0N/A * certificate will be ignored. 0N/A // search for X509Data in keyinfo 0N/A // Looking for CRL before finding certificates 0N/A // skip non-X509Certificate entries 0N/A * KeySelector which would retrieve the public key out of the 0N/A * KeyValue element and return it. 0N/A * NOTE: If the key algorithm doesn't match signature algorithm, 0N/A * then the public key will be ignored. 0N/A // make sure algorithm is compatible with method 0N/A //@@@FIXME: this should also work for key types other than DSA/RSA 0N/A * KeySelector which would perform special lookup as documented 0N/A * matching public key. 0N/A // not going to happen 0N/A // Lookup the public key using the key name 'Xxx', 0N/A // assume KeyName contains subject DN and search 0N/A // collection of certs for match 0N/A // Lookup the public key using the retrievel method. 0N/A // NOTE: only X509Certificate type is supported. 0N/A (
"Unsupported RetrievalMethod type");
0N/A // Lookup the public key using the information 0N/A // specified in X509Data element, i.e. searching 0N/A // over the collection of certificate files under 0N/A // "certs" subdirectory and return those match. 0N/A }
else if (
obj instanceof byte[]) {