Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java SAML的SP元数据生成-需要澄清X509标记_Java_Metadata_X509certificate_Saml 2.0 - Fatal编程技术网

Java SAML的SP元数据生成-需要澄清X509标记

Java SAML的SP元数据生成-需要澄清X509标记,java,metadata,x509certificate,saml-2.0,Java,Metadata,X509certificate,Saml 2.0,我是新来的SAML。我做了很多研究,现在非常清楚整个流程是如何工作的。但在SP端的元数据文件生成方面遇到了难题 我读了一些文章,并编写了生成元数据文件的工作代码。但我不明白的是元数据中的证书部分。由于我在SP端,我应该使用IDP用于加密的公钥。但是,当我看到元数据生成的逻辑(在许多不同的站点中)时,证书附加逻辑如下所示: //Fetch the private key certificate and pass it to the below method. This metho

我是新来的SAML。我做了很多研究,现在非常清楚整个流程是如何工作的。但在SP端的元数据文件生成方面遇到了难题

我读了一些文章,并编写了生成元数据文件的工作代码。但我不明白的是元数据中的证书部分。由于我在SP端,我应该使用IDP用于加密的公钥。但是,当我看到元数据生成的逻辑(在许多不同的站点中)时,证书附加逻辑如下所示:

        //Fetch the private key certificate and pass it to the below method.
 This method's Java doc for SecurityHelper.getSimpleCredential method says 
"Get a simple, minimal credential containing an end-entity X.509 certificate, and optionally a private key. "

     SecurityHelper.getSimpleCredential(x509Certificate, privateKey);
                    try {
            //Add it to the signing descriptor of metadata    
            signingKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(difiCredential.toX509Credential()));
                        } catch (SecurityException e) {
                            System.out.println(e.getMessage()+ e);
                        }

        spSPSSODescriptor.getKeyDescriptors().add(signingKeyDescriptor);
  • 这个方法有什么作用?它是否生成公钥并附加到我的元数据中
  • 如果没有,为什么我们要将私钥附加到SP的元数据中,这些元数据将共享给我的IDP,而我的IDP根本不需要私钥?我不应该共享他们可以用来加密的公钥吗?然后我会在内部使用我的私钥来解密它
  • 我想在生成元数据之前非常确定,因为它具有安全含义

    谢谢